Skip to content

Commit

Permalink
fix toDataurl and zoom change (#5278)
Browse files Browse the repository at this point in the history
  • Loading branch information
asturur authored Sep 29, 2018
1 parent 68a84a7 commit fdd2d94
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/shapes/object.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
14 changes: 6 additions & 8 deletions src/static_canvas.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit fdd2d94

Please sign in to comment.