mirror of
https://github.com/konvajs/konva.git
synced 2025-12-17 18:01:15 +08:00
fixed up caching now that transformsEnabled attr has been removed
This commit is contained in:
18
src/Node.js
18
src/Node.js
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user