From eeffa39c18eba2667d53468d94e91a4d966ace82 Mon Sep 17 00:00:00 2001 From: Andrea Bogazzi Date: Sat, 29 Sep 2018 18:34:00 +0200 Subject: [PATCH] fix toDataurl and zoom change --- src/shapes/object.class.js | 2 +- src/static_canvas.class.js | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/shapes/object.class.js b/src/shapes/object.class.js index 803c9f54e87..7eba9db4c3c 100644 --- a/src/shapes/object.class.js +++ b/src/shapes/object.class.js @@ -1077,7 +1077,7 @@ if (!this._cacheCanvas) { this._createCacheCanvas(); } - if (this.isCacheDirty(false)) { + if (this.isCacheDirty()) { this.statefullCache && this.saveState({ propertySet: 'cacheProperties' }); this.drawObject(this._cacheContext, options.forClipping); this.dirty = false; diff --git a/src/static_canvas.class.js b/src/static_canvas.class.js index 8a36dd0fb04..bc15a99095f 100644 --- a/src/static_canvas.class.js +++ b/src/static_canvas.class.js @@ -931,13 +931,11 @@ ctx.restore(); } if (path) { - if (path.isCacheDirty()) { - // needed to setup a couple of variables - path.shouldCache(); - path.canvas = this; - path._transformDone = true; - path.renderCache({ forClipping: true }); - } + path.canvas = this; + // needed to setup a couple of variables + path.shouldCache(); + path._transformDone = true; + path.renderCache({ forClipping: true }); this.drawClipPathOnCanvas(ctx); } this._renderOverlay(ctx); @@ -956,7 +954,7 @@ ctx.save(); ctx.transform(v[0], v[1], v[2], v[3], v[4], v[5]); // DEBUG: uncomment this line, comment the following - // ctx.globalAlpha = 0.4 + // ctx.globalAlpha = 0.4; ctx.globalCompositeOperation = 'destination-in'; path.transform(ctx); ctx.scale(1 / path.zoomX, 1 / path.zoomY);