mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Ensure that PDFViewerApplication.{zoomIn, zoomOut}
won't run when PresentationMode is active (PR 10652 follow-up)
Similar to the `zoomReset` method we need to ensure that this code won't run for zoom events originating within the browser UI itself, since checks in e.g. the `keydown` event handler won't help in that case.
This commit is contained in:
parent
d7afb74a6e
commit
19f6facc1e
1 changed files with 6 additions and 0 deletions
|
@ -412,6 +412,9 @@ let PDFViewerApplication = {
|
|||
},
|
||||
|
||||
zoomIn(ticks) {
|
||||
if (this.pdfViewer.isInPresentationMode) {
|
||||
return;
|
||||
}
|
||||
let newScale = this.pdfViewer.currentScale;
|
||||
do {
|
||||
newScale = (newScale * DEFAULT_SCALE_DELTA).toFixed(2);
|
||||
|
@ -422,6 +425,9 @@ let PDFViewerApplication = {
|
|||
},
|
||||
|
||||
zoomOut(ticks) {
|
||||
if (this.pdfViewer.isInPresentationMode) {
|
||||
return;
|
||||
}
|
||||
let newScale = this.pdfViewer.currentScale;
|
||||
do {
|
||||
newScale = (newScale / DEFAULT_SCALE_DELTA).toFixed(2);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue