Merge pull request #20798 from calixteman/bug2016437

Fix the position of the thumbnails on the last line (bug 2016437)
This commit is contained in:
Tim van der Meij 2026-03-05 21:19:39 +01:00 committed by GitHub
commit d3e04d29ac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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