Skip to content

Commit af3d13c

Browse files
committed
Use the MathClamp helper function more in the web/ folder (PR 19617 follow-up)
There's one more spot that I missed in PR 19617.
1 parent efc5c3c commit af3d13c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

web/pdf_viewer.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import {
3232
AnnotationEditorType,
3333
AnnotationEditorUIManager,
3434
AnnotationMode,
35+
MathClamp,
3536
PermissionFlag,
3637
PixelsPerInch,
3738
shadow,
@@ -2294,7 +2295,7 @@ class PDFViewer {
22942295
newScale = round((newScale * delta).toFixed(2) * 10) / 10;
22952296
} while (--steps > 0);
22962297
}
2297-
newScale = Math.max(MIN_SCALE, Math.min(MAX_SCALE, newScale));
2298+
newScale = MathClamp(newScale, MIN_SCALE, MAX_SCALE);
22982299
this.#setScale(newScale, { noScroll: false, drawingDelay, origin });
22992300
}
23002301

0 commit comments

Comments
 (0)