Merge pull request #19714 from Snuffleupagus/MathClamp-3

Use the `MathClamp` helper function even more (PR 19617 follow-up)
This commit is contained in:
Jonas Jenwald 2025-03-24 16:35:07 +01:00 committed by GitHub
commit d8d4f2a850
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1006,15 +1006,14 @@ class AnnotationEditor {
); );
} else if (isHorizontal) { } else if (isHorizontal) {
ratioX = ratioX =
Math.max( MathClamp(Math.abs(oppositePoint[0] - point[0] - deltaX), minWidth, 1) /
minWidth, savedWidth;
Math.min(1, Math.abs(oppositePoint[0] - point[0] - deltaX))
) / savedWidth;
} else { } else {
ratioY = ratioY =
Math.max( MathClamp(
Math.abs(oppositePoint[1] - point[1] - deltaY),
minHeight, minHeight,
Math.min(1, Math.abs(oppositePoint[1] - point[1] - deltaY)) 1
) / savedHeight; ) / savedHeight;
} }