Skip to content
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.

Commit

Permalink
Better mouse support when lockScalingFlip is true. (fabricjs#4225)
Browse files Browse the repository at this point in the history
  • Loading branch information
ncou authored and rkrueger11 committed Sep 6, 2017
1 parent 01e3fee commit 70efc4a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/canvas.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -841,14 +841,16 @@

if (lockScalingFlip && scaleX <= 0 && scaleX < target.scaleX) {
forbidScalingX = true;
localMouse.x = 0;
}

if (lockScalingFlip && scaleY <= 0 && scaleY < target.scaleY) {
forbidScalingY = true;
localMouse.y = 0;
}

if (by === 'equally' && !lockScalingX && !lockScalingY) {
forbidScalingX || forbidScalingY || (scaled = this._scaleObjectEqually(localMouse, target, transform, _dim));
scaled = this._scaleObjectEqually(localMouse, target, transform, _dim);
}
else if (!by) {
forbidScalingX || lockScalingX || (target.set('scaleX', scaleX) && (scaled = scaled || changeX));
Expand Down

0 comments on commit 70efc4a

Please sign in to comment.