Skip to content

Commit d8d4f2a

Browse files
Merge pull request #19714 from Snuffleupagus/MathClamp-3
Use the `MathClamp` helper function even more (PR 19617 follow-up)
2 parents bcba053 + 4547e58 commit d8d4f2a

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

src/display/editor/editor.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,15 +1006,14 @@ class AnnotationEditor {
10061006
);
10071007
} else if (isHorizontal) {
10081008
ratioX =
1009-
Math.max(
1010-
minWidth,
1011-
Math.min(1, Math.abs(oppositePoint[0] - point[0] - deltaX))
1012-
) / savedWidth;
1009+
MathClamp(Math.abs(oppositePoint[0] - point[0] - deltaX), minWidth, 1) /
1010+
savedWidth;
10131011
} else {
10141012
ratioY =
1015-
Math.max(
1013+
MathClamp(
1014+
Math.abs(oppositePoint[1] - point[1] - deltaY),
10161015
minHeight,
1017-
Math.min(1, Math.abs(oppositePoint[1] - point[1] - deltaY))
1016+
1
10181017
) / savedHeight;
10191018
}
10201019

0 commit comments

Comments
 (0)