diff --git a/web/base_viewer.js b/web/base_viewer.js index 3b9b78ca40e1ad..060cf331f79bdc 100644 --- a/web/base_viewer.js +++ b/web/base_viewer.js @@ -735,6 +735,11 @@ class BaseViewer { if (!currentPage) { return; } + const factor = + this.spreadMode === SpreadMode.NONE || this._isScrollModeHorizontal + ? 1 + : 2; + const noPadding = this.isInPresentationMode || this.removePageBorders; let hPadding = noPadding ? 0 : SCROLLBAR_PADDING; let vPadding = noPadding ? 0 : VERTICAL_PADDING; @@ -743,8 +748,9 @@ class BaseViewer { [hPadding, vPadding] = [vPadding, hPadding]; // Swap the padding values. } const pageWidthScale = - ((this.container.clientWidth - hPadding) / currentPage.width) * - currentPage.scale; + (((this.container.clientWidth - hPadding) / currentPage.width) * + currentPage.scale) / + factor; const pageHeightScale = ((this.container.clientHeight - vPadding) / currentPage.height) * currentPage.scale;