diff --git a/src/core/operator_list.js b/src/core/operator_list.js index 64091bc9a..f63ac0718 100644 --- a/src/core/operator_list.js +++ b/src/core/operator_list.js @@ -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: diff --git a/test/pdfs/.gitignore b/test/pdfs/.gitignore index c5dcca40e..1bd14c54d 100644 --- a/test/pdfs/.gitignore +++ b/test/pdfs/.gitignore @@ -904,3 +904,4 @@ !three_pages_with_number.pdf !issue13520.pdf !22060_A1_01_Plans.pdf +!issue21126.pdf diff --git a/test/pdfs/issue21126.pdf b/test/pdfs/issue21126.pdf new file mode 100644 index 000000000..f0a535807 Binary files /dev/null and b/test/pdfs/issue21126.pdf differ diff --git a/test/test_manifest.json b/test/test_manifest.json index f4ead7c85..25a605031 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -14136,5 +14136,12 @@ "firstPage": 3, "lastPage": 3, "type": "eq" + }, + { + "id": "issue21126", + "file": "pdfs/issue21126.pdf", + "md5": "29c23022ab3d983733e1ee37fd0bc785", + "rounds": 1, + "type": "eq" } ]