finished pixel detection algo which can be applied to any Shape. This enables a lot of new functionality, such as image pixel detection, shape border detection, and custom shape detection that isn't drawn with a standard path

This commit is contained in:
Eric Rowell
2012-04-01 01:08:33 -07:00
parent 08e2b74da9
commit 95fabe9160
6 changed files with 140 additions and 17 deletions

View File

@@ -254,7 +254,7 @@ Kinetic.Stage.prototype = {
this.targetFound = true;
}
if(shape.visible && pos !== undefined && shape._isPointInPath(pos)) {
if(shape.visible && pos !== undefined && shape._isPointInShape(pos)) {
// handle onmousedown
if(!isDragging && this.mouseDown) {
this.mouseDown = false;
@@ -456,8 +456,8 @@ Kinetic.Stage.prototype = {
* clear default layers
*/
_clearDefaultLayers: function() {
var pathLayer = this.pathLayer;
pathLayer.clear();
this.bufferLayer.clear();
this.pathLayer.clear();
},
/**
* begin listening for events by adding event handlers