reworked pixel detection. I now require the dev to use shape.save() to save the pixel data for performance reasons

This commit is contained in:
Eric Rowell
2012-04-01 19:38:30 -07:00
parent 72c0555d0b
commit 6ce9d5489c
6 changed files with 121 additions and 135 deletions

View File

@@ -548,16 +548,17 @@ Test.prototype.tests = {
log('mouseout');
});
darth.on('dragend', function() {
this.save();
});
layer.add(darth);
stage.add(layer);
//darth.save();
};
imageObj.src = '../lion.png';
},
/*
* TODO: need to implement area x, y, width and height
* in order to support other shape pixel detection
*/
/*
'EVENTS - star pixel detection': function(containerId) {
var imageObj = new Image();
imageObj.onload = function() {
@@ -591,12 +592,17 @@ Test.prototype.tests = {
log('mouseout');
});
star.on('dragend', function() {
this.save();
});
layer.add(star);
stage.add(layer);
star.save();
};
imageObj.src = '../lion.png';
},
*/
'EVENTS - drag events click': function(containerId) {
var stage = new Kinetic.Stage({
container: containerId,
@@ -1278,8 +1284,8 @@ Test.prototype.tests = {
});
var layer = new Kinetic.Layer();
var group = new Kinetic.Group({
x: 0,
y: 10
x: 0,
y: 10
});
var circle = new Kinetic.Circle({
x: stage.width / 2,