mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-06-27 18:45:48 +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;
|
firstRightX ??= prevX + w;
|
||||||
positionsX.push(prevX);
|
positionsX.push(prevX);
|
||||||
}
|
}
|
||||||
if (reminder > 0 && i >= ii - reminder) {
|
|
||||||
const cx = x + w / 2;
|
|
||||||
positionsLastX.push(cx);
|
|
||||||
lastRightX ??= cx + w;
|
|
||||||
}
|
|
||||||
if (y > prevY) {
|
if (y > prevY) {
|
||||||
if (reminder === -1 && positionsX.length > 1) {
|
if (reminder === -1 && positionsX.length > 1) {
|
||||||
reminder = ii % positionsX.length;
|
reminder = ii % positionsX.length;
|
||||||
@ -911,6 +906,11 @@ class PDFThumbnailViewer {
|
|||||||
firstBottomY ??= prevY + h;
|
firstBottomY ??= prevY + h;
|
||||||
positionsY.push(prevY);
|
positionsY.push(prevY);
|
||||||
}
|
}
|
||||||
|
if (reminder > 0 && i >= ii - reminder) {
|
||||||
|
const cx = x + w / 2;
|
||||||
|
positionsLastX.push(cx);
|
||||||
|
lastRightX ??= cx + w;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const space =
|
const space =
|
||||||
positionsX.length > 1
|
positionsX.length > 1
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user