mirror of
https://github.com/konvajs/konva.git
synced 2026-01-09 20:14:41 +08:00
Update clearing of getImageData cache
This commit is contained in:
@@ -307,6 +307,9 @@
|
||||
cachedHitCanvas = cachedCanvas && cachedCanvas.hit;
|
||||
|
||||
if (this.shouldDrawHit()) {
|
||||
if (layer) {
|
||||
layer.imageData = null; // Clear getImageData cache
|
||||
}
|
||||
if (cachedHitCanvas) {
|
||||
this._drawCachedHitCanvas(context);
|
||||
}
|
||||
|
||||
@@ -176,7 +176,6 @@
|
||||
}
|
||||
|
||||
Kinetic.Container.prototype.drawHit.call(this, canvas, top);
|
||||
this.imageData = null; // Clear imageData cache
|
||||
return this;
|
||||
},
|
||||
/**
|
||||
@@ -195,7 +194,7 @@
|
||||
clear: function(bounds) {
|
||||
this.getContext().clear(bounds);
|
||||
this.getHitCanvas().getContext().clear(bounds);
|
||||
this.imageData = null; // Clear imageData cache
|
||||
this.imageData = null; // Clear getImageData cache
|
||||
return this;
|
||||
},
|
||||
// extend Node.prototype.setVisible
|
||||
|
||||
@@ -203,7 +203,7 @@
|
||||
cachedHitCanvas = cachedCanvas && cachedCanvas.hit;
|
||||
|
||||
if(this.shouldDrawHit()) {
|
||||
|
||||
layer.imageData = null; // Clear getImageData cache
|
||||
if (cachedHitCanvas) {
|
||||
this._drawCachedHitCanvas(context);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user