fix toDataurl and zoom change (#5278)

This commit is contained in:
Andrea Bogazzi 2018-09-29 13:43:31 -04:00 committed by GitHub
parent 68a84a7da7
commit fdd2d94e77
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 9 deletions

View file

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

View file

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