Skip to content

Commit

Permalink
removed Math.ceil call when calculating new width in resize handler
Browse files Browse the repository at this point in the history
  • Loading branch information
Soldier-B committed Sep 27, 2024
1 parent 3a429e4 commit 3a37c46
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/controls/changeWidth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@ export const changeObjectWidth: TransformActionHandler = (
target.strokeWidth / (target.strokeUniform ? target.scaleX : 1),
multiplier = isTransformCentered(transform) ? 2 : 1,
oldWidth = target.width,
newWidth = Math.ceil(
Math.abs((localPoint.x * multiplier) / target.scaleX) - strokePadding,
);
newWidth =
Math.abs((localPoint.x * multiplier) / target.scaleX) - strokePadding;
target.set('width', Math.max(newWidth, 0));
// check against actual target width in case `newWidth` was rejected
return oldWidth !== target.width;
Expand Down

0 comments on commit 3a37c46

Please sign in to comment.