Skip to content

Commit c2d8854

Browse files
Merge pull request #19868 from Snuffleupagus/MathClamp-4
Use the `MathClamp` helper function more in the `web/` folder (PR 19617 follow-up)
2 parents 6891602 + af3d13c commit c2d8854

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)