mirror of
https://github.com/konvajs/konva.git
synced 2025-10-15 12:34:52 +08:00
when using pixel detection, clear shape data whenever shape is drawn
This commit is contained in:
@@ -146,7 +146,7 @@ Kinetic.Shape.prototype = {
|
||||
this.drawFunc = func;
|
||||
},
|
||||
/**
|
||||
* save shape data when using pixel detection.
|
||||
* save shape data when using pixel detection.
|
||||
*/
|
||||
save: function() {
|
||||
var stage = this.getStage();
|
||||
@@ -193,6 +193,11 @@ Kinetic.Shape.prototype = {
|
||||
this.drawFunc.call(this);
|
||||
context.restore();
|
||||
}
|
||||
|
||||
// clear shape data
|
||||
if(this.detectionType === 'pixel') {
|
||||
this.data = [];
|
||||
}
|
||||
},
|
||||
/**
|
||||
* custom isPointInPath method which can use path detection
|
||||
|
Reference in New Issue
Block a user