mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 22:58:07 +02:00
Merge pull request #19714 from Snuffleupagus/MathClamp-3
Use the `MathClamp` helper function even more (PR 19617 follow-up)
This commit is contained in:
commit
d8d4f2a850
1 changed files with 5 additions and 6 deletions
|
@ -1006,15 +1006,14 @@ class AnnotationEditor {
|
|||
);
|
||||
} else if (isHorizontal) {
|
||||
ratioX =
|
||||
Math.max(
|
||||
minWidth,
|
||||
Math.min(1, Math.abs(oppositePoint[0] - point[0] - deltaX))
|
||||
) / savedWidth;
|
||||
MathClamp(Math.abs(oppositePoint[0] - point[0] - deltaX), minWidth, 1) /
|
||||
savedWidth;
|
||||
} else {
|
||||
ratioY =
|
||||
Math.max(
|
||||
MathClamp(
|
||||
Math.abs(oppositePoint[1] - point[1] - deltaY),
|
||||
minHeight,
|
||||
Math.min(1, Math.abs(oppositePoint[1] - point[1] - deltaY))
|
||||
1
|
||||
) / savedHeight;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue