Skip to content

Commit

Permalink
Apply viewport transform when calculating isTargetTransparent (#2980)
Browse files Browse the repository at this point in the history
  • Loading branch information
kherock authored and asturur committed Jul 2, 2016
1 parent 2cd06c9 commit 62da4fd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/canvas.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,19 +355,21 @@

target.hasBorders = target.transparentCorners = false;

ctx.save();
ctx.transform.apply(ctx, this.viewportTransform);
if (shouldTransform) {
ctx.save();
ctx.transform.apply(ctx, target.group.calcTransformMatrix());
}
target.render(ctx);
ctx.restore();

target.active && target._renderControls(ctx);

target.hasBorders = hasBorders;
target.transparentCorners = transparentCorners;

var isTransparent = fabric.util.isTransparent(
ctx, x, y, this.targetFindTolerance);
shouldTransform && ctx.restore();

this.clearContext(ctx);

Expand Down

0 comments on commit 62da4fd

Please sign in to comment.