Merge pull request #21127 from calixteman/issue21126

Correctly compute the bbox when simplifying the path construction
This commit is contained in:
Tim van der Meij 2026-04-20 20:48:24 +02:00 committed by GitHub
commit badebcca00
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 12 additions and 1 deletions

View File

@ -15,6 +15,7 @@
import {
DrawOPS,
F32_BBOX_INIT,
ImageKind,
OPS,
RenderingIntentFlag,
@ -520,7 +521,9 @@ addState(
const [, [buffer], minMax] = args;
if (minMax) {
Util.scaleMinMax(transform, minMax);
const newBBox = F32_BBOX_INIT.slice();
Util.axialAlignedBoundingBox(minMax, transform, newBBox);
minMax.set(newBBox);
for (let k = 0, kk = buffer.length; k < kk; ) {
switch (buffer[k++]) {
case DrawOPS.moveTo:

View File

@ -904,3 +904,4 @@
!three_pages_with_number.pdf
!issue13520.pdf
!22060_A1_01_Plans.pdf
!issue21126.pdf

BIN
test/pdfs/issue21126.pdf Normal file

Binary file not shown.

View File

@ -14136,5 +14136,12 @@
"firstPage": 3,
"lastPage": 3,
"type": "eq"
},
{
"id": "issue21126",
"file": "pdfs/issue21126.pdf",
"md5": "29c23022ab3d983733e1ee37fd0bc785",
"rounds": 1,
"type": "eq"
}
]