Skip to content

Commit 7f76a11

Browse files
committed
Fix the position of the thumbnails on the last line (bug 2016437)
The original issue can only be reproduce when the thumbnails are on two lines. The fix is just a matter of computing the number of elements on the last line once we've finished the first line.
1 parent c41be4f commit 7f76a11

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

web/pdf_thumbnail_viewer.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -898,11 +898,6 @@ class PDFThumbnailViewer {
898898
firstRightX ??= prevX + w;
899899
positionsX.push(prevX);
900900
}
901-
if (reminder > 0 && i >= ii - reminder) {
902-
const cx = x + w / 2;
903-
positionsLastX.push(cx);
904-
lastRightX ??= cx + w;
905-
}
906901
if (y > prevY) {
907902
if (reminder === -1 && positionsX.length > 1) {
908903
reminder = ii % positionsX.length;
@@ -911,6 +906,11 @@ class PDFThumbnailViewer {
911906
firstBottomY ??= prevY + h;
912907
positionsY.push(prevY);
913908
}
909+
if (reminder > 0 && i >= ii - reminder) {
910+
const cx = x + w / 2;
911+
positionsLastX.push(cx);
912+
lastRightX ??= cx + w;
913+
}
914914
}
915915
const space =
916916
positionsX.length > 1

0 commit comments

Comments
 (0)