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

View File

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

View File

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