Update clearing of getImageData cache

This commit is contained in:
Victor Michnowicz
2014-05-17 00:06:46 -04:00
parent 3214b680c5
commit 70564cc1e4
3 changed files with 5 additions and 3 deletions

View File

@@ -307,6 +307,9 @@
cachedHitCanvas = cachedCanvas && cachedCanvas.hit;
if (this.shouldDrawHit()) {
if (layer) {
layer.imageData = null; // Clear getImageData cache
}
if (cachedHitCanvas) {
this._drawCachedHitCanvas(context);
}

View File

@@ -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

View File

@@ -203,7 +203,7 @@
cachedHitCanvas = cachedCanvas && cachedCanvas.hit;
if(this.shouldDrawHit()) {
layer.imageData = null; // Clear getImageData cache
if (cachedHitCanvas) {
this._drawCachedHitCanvas(context);
}