mirror of
https://github.com/konvajs/konva.git
synced 2025-10-15 12:34:52 +08:00
changed isPointInShape() to intersects(). Currently the method accepts a point object, but I may extend this to also accept another shape object
This commit is contained in:
@@ -171,10 +171,9 @@ Kinetic.Shape.prototype = {
|
||||
this.data = [];
|
||||
},
|
||||
/**
|
||||
* custom isPointInPath method which can use path detection
|
||||
* or pixel detection
|
||||
* determines if point is in the shape
|
||||
*/
|
||||
isPointInShape: function(pos) {
|
||||
intersects: function(pos) {
|
||||
var stage = this.getStage();
|
||||
|
||||
if(this.attrs.detectionType === 'path') {
|
||||
|
@@ -364,7 +364,7 @@ Kinetic.Stage.prototype = {
|
||||
this.targetFound = true;
|
||||
}
|
||||
|
||||
if(shape.attrs.visible && pos !== undefined && shape.isPointInShape(pos)) {
|
||||
if(shape.attrs.visible && pos !== undefined && shape.intersects(pos)) {
|
||||
// handle onmousedown
|
||||
if(!isDragging && this.mouseDown) {
|
||||
this.mouseDown = false;
|
||||
|
Reference in New Issue
Block a user