Merge pull request #15875 from Snuffleupagus/viewer-name-consistency

Improve name consistency in the viewer (PR 15812 follow-up)
This commit is contained in:
Jonas Jenwald 2022-12-29 11:52:25 +01:00 committed by GitHub
commit c791e01bfc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 12 deletions

View File

@ -656,7 +656,7 @@ const PDFViewerApplication = {
return; return;
} }
this.pdfViewer.increaseScale(steps, { this.pdfViewer.increaseScale(steps, {
delay: AppOptions.get("defaultZoomDelay"), drawingDelay: AppOptions.get("defaultZoomDelay"),
}); });
}, },
@ -665,7 +665,7 @@ const PDFViewerApplication = {
return; return;
} }
this.pdfViewer.decreaseScale(steps, { this.pdfViewer.decreaseScale(steps, {
delay: AppOptions.get("defaultZoomDelay"), drawingDelay: AppOptions.get("defaultZoomDelay"),
}); });
}, },

View File

@ -599,7 +599,6 @@ class PDFPageView {
isScalingRestricted = true; isScalingRestricted = true;
} }
} }
const postponeDrawing = drawingDelay >= 0 && drawingDelay < 1000; const postponeDrawing = drawingDelay >= 0 && drawingDelay < 1000;
if (this.canvas) { if (this.canvas) {

View File

@ -1083,7 +1083,7 @@ class PDFViewer {
_setScaleUpdatePages( _setScaleUpdatePages(
newScale, newScale,
newValue, newValue,
{ noScroll = false, preset = false, delay: drawingDelay = -1 } { noScroll = false, preset = false, drawingDelay = -1 }
) { ) {
this._currentScaleValue = newValue.toString(); this._currentScaleValue = newValue.toString();
@ -1103,16 +1103,13 @@ class PDFViewer {
newScale * PixelsPerInch.PDF_TO_CSS_UNITS newScale * PixelsPerInch.PDF_TO_CSS_UNITS
); );
const mustPostponeDrawing = drawingDelay >= 0 && drawingDelay < 1000; const postponeDrawing = drawingDelay >= 0 && drawingDelay < 1000;
const updateArgs = { this.refresh(true, {
scale: newScale, scale: newScale,
}; drawingDelay: postponeDrawing ? drawingDelay : -1,
if (mustPostponeDrawing) { });
updateArgs.drawingDelay = drawingDelay;
}
this.refresh(true, updateArgs);
if (mustPostponeDrawing) { if (postponeDrawing) {
this.#scaleTimeoutId = setTimeout(() => { this.#scaleTimeoutId = setTimeout(() => {
this.#scaleTimeoutId = null; this.#scaleTimeoutId = null;
this.refresh(); this.refresh();