pixel detection performance was horrible for large amounts of shapes. Added some optimizations which require knowledge of a shape's perceivable position and size based on transforms. This will be added in later. For the time being, only Kinetic.Images will have access to the detectionType property. Image cannot be transformed or offset with the center offset. Support for these will come soon as well.

This commit is contained in:
Eric Rowell
2012-04-01 17:18:01 -07:00
parent 313c6a1541
commit 72c0555d0b
4 changed files with 67 additions and 23 deletions

View File

@@ -553,6 +553,11 @@ Test.prototype.tests = {
};
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,6 +596,7 @@ Test.prototype.tests = {
};
imageObj.src = '../lion.png';
},
*/
'EVENTS - drag events click': function(containerId) {
var stage = new Kinetic.Stage({
container: containerId,