Merge pull request #15798 from Snuffleupagus/PresentationMode-spreadMode-hPadding

Fix page-switching for landscape documents with SpreadModes and PresentationMode (PR 14877 follow-up)
This commit is contained in:
Jonas Jenwald 2022-12-09 14:19:09 +01:00 committed by GitHub
commit 3155e2a63b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1163,7 +1163,14 @@ class PDFViewer {
vPadding = VERTICAL_PADDING;
if (this.isInPresentationMode) {
hPadding = vPadding = 4;
// Pages have a 2px (transparent) border in PresentationMode, see
// the `web/pdf_viewer.css` file.
hPadding = vPadding = 4; // 2 * 2px
if (this._spreadMode !== SpreadMode.NONE) {
// Account for two pages being visible in PresentationMode, thus
// "doubling" the total border width.
hPadding *= 2;
}
} else if (this.removePageBorders) {
hPadding = vPadding = 0;
} else if (this._scrollMode === ScrollMode.HORIZONTAL) {