Skip to content

Commit

Permalink
Fix page-switching for landscape documents with SpreadModes and Prese…
Browse files Browse the repository at this point in the history
…ntationMode (PR 14877 follow-up)

In PR 14877 I forgot to update the horizontal padding, used when computing the scale of the pages, for the case where SpreadModes and PresentationMode is being used together.

Steps to reproduce:
 1. Open the viewer with the default `tracemonkey.pdf` document.
 1. Enable any SpreadMode.
 2. Rotate the document *once*, either clockwise or counterclockwise.
 3. Enter PresentationMode.
 4. Try swithching page, e.g. by clicking on the document.

Expected result:
 The visible pages change as you click.

Actual result:
 The visible pages are "stuck" in the current view.
  • Loading branch information
Snuffleupagus committed Dec 9, 2022
1 parent ba2fec9 commit f558ea1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions web/pdf_viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1164,6 +1164,9 @@ class PDFViewer {

if (this.isInPresentationMode) {
hPadding = vPadding = 4;
if (this._spreadMode !== SpreadMode.NONE) {
hPadding *= 2;
}
} else if (this.removePageBorders) {
hPadding = vPadding = 0;
} else if (this._scrollMode === ScrollMode.HORIZONTAL) {
Expand Down

0 comments on commit f558ea1

Please sign in to comment.