mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-04-09 14:54:04 +02:00
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.
This commit is contained in:
parent
c41be4fd88
commit
7f76a111c4
@ -898,11 +898,6 @@ class PDFThumbnailViewer {
|
||||
firstRightX ??= prevX + w;
|
||||
positionsX.push(prevX);
|
||||
}
|
||||
if (reminder > 0 && i >= ii - reminder) {
|
||||
const cx = x + w / 2;
|
||||
positionsLastX.push(cx);
|
||||
lastRightX ??= cx + w;
|
||||
}
|
||||
if (y > prevY) {
|
||||
if (reminder === -1 && positionsX.length > 1) {
|
||||
reminder = ii % positionsX.length;
|
||||
@ -911,6 +906,11 @@ class PDFThumbnailViewer {
|
||||
firstBottomY ??= prevY + h;
|
||||
positionsY.push(prevY);
|
||||
}
|
||||
if (reminder > 0 && i >= ii - reminder) {
|
||||
const cx = x + w / 2;
|
||||
positionsLastX.push(cx);
|
||||
lastRightX ??= cx + w;
|
||||
}
|
||||
}
|
||||
const space =
|
||||
positionsX.length > 1
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user