fixed up caching now that transformsEnabled attr has been removed

This commit is contained in:
Eric Rowell
2014-03-09 22:59:53 -07:00
parent a2ec418fe8
commit aa7f56be26
2 changed files with 57 additions and 17 deletions

View File

@@ -150,6 +150,7 @@
width = conf.width || this.width(),
height = conf.height || this.height(),
drawBorder = conf.drawBorder || false,
layer = this.getLayer(),
cachedSceneCanvas = new Kinetic.SceneCanvas({
pixelRatio: 1,
width: width,
@@ -171,13 +172,10 @@
this.clearCache();
// TODO: removing transformsEnabled property because it's weird.
// need to find another way to handle this
//this.transformsEnabled('position');
this.x(x * -1);
this.y(y * -1);
var layerApplyTrans = layer._applyTransform;
layer._applyTransform = function(shape, context) {
context.translate(x * -1, y * -1);
};
this.drawScene(cachedSceneCanvas);
this.drawHit(cachedHitCanvas);
@@ -196,10 +194,8 @@
sceneContext.restore();
}
this.x(origX);
this.y(origY);
//this.transformsEnabled(origTransEnabled);
// set the _applyTransform method back to the original
layer._applyTransform = layerApplyTrans;
this._cache.canvas = {