mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-03-16 22:10:32 +00:00
fixes problems with isTargetTransparent trageting. also nulls out cachedCanvas when not being used to make it easier to check if a proper cachedCanvas exists (#4356)
This commit is contained in:
parent
cc7c36fa7d
commit
0bb8a131a6
2 changed files with 5 additions and 3 deletions
|
|
@ -483,9 +483,10 @@
|
|||
var ctx = this.contextCache,
|
||||
originalColor = target.selectionBackgroundColor;
|
||||
|
||||
target.hasBorders = target.transparentCorners = false;
|
||||
target.selectionBackgroundColor = '';
|
||||
|
||||
this.clearContext(ctx);
|
||||
|
||||
ctx.save();
|
||||
ctx.transform.apply(ctx, this.viewportTransform);
|
||||
target.render(ctx);
|
||||
|
|
@ -494,6 +495,8 @@
|
|||
target === this._activeObject && target._renderControls(ctx, {
|
||||
hasBorders: false,
|
||||
transparentCorners: false
|
||||
}, {
|
||||
hasBorders: false,
|
||||
});
|
||||
|
||||
target.selectionBackgroundColor = originalColor;
|
||||
|
|
@ -501,8 +504,6 @@
|
|||
var isTransparent = fabric.util.isTransparent(
|
||||
ctx, x, y, this.targetFindTolerance);
|
||||
|
||||
this.clearContext(ctx);
|
||||
|
||||
return isTransparent;
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -986,6 +986,7 @@
|
|||
this.drawCacheOnCanvas(ctx);
|
||||
}
|
||||
else {
|
||||
this._cacheCanvas = null;
|
||||
this.dirty = false;
|
||||
this.drawObject(ctx);
|
||||
if (this.objectCaching && this.statefullCache) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue