diff --git a/src/display/canvas.js b/src/display/canvas.js index bae1da84f..c483e5163 100644 --- a/src/display/canvas.js +++ b/src/display/canvas.js @@ -517,10 +517,13 @@ class CanvasExtraState { updateRectMinMax(transform, rect) { const p1 = Util.applyTransform(rect, transform); const p2 = Util.applyTransform(rect.slice(2), transform); - this.minX = Math.min(this.minX, p1[0], p2[0]); - this.minY = Math.min(this.minY, p1[1], p2[1]); - this.maxX = Math.max(this.maxX, p1[0], p2[0]); - this.maxY = Math.max(this.maxY, p1[1], p2[1]); + const p3 = Util.applyTransform([rect[0], rect[3]], transform); + const p4 = Util.applyTransform([rect[2], rect[1]], transform); + + this.minX = Math.min(this.minX, p1[0], p2[0], p3[0], p4[0]); + this.minY = Math.min(this.minY, p1[1], p2[1], p3[1], p4[1]); + this.maxX = Math.max(this.maxX, p1[0], p2[0], p3[0], p4[0]); + this.maxY = Math.max(this.maxY, p1[1], p2[1], p3[1], p4[1]); } updateScalingPathMinMax(transform, minMax) { diff --git a/test/pdfs/.gitignore b/test/pdfs/.gitignore index bcc279054..12d64ee27 100644 --- a/test/pdfs/.gitignore +++ b/test/pdfs/.gitignore @@ -613,3 +613,4 @@ !empty_protected.pdf !tagged_stamp.pdf !bug1851498.pdf +!issue17065.pdf diff --git a/test/pdfs/issue17065.pdf b/test/pdfs/issue17065.pdf new file mode 100644 index 000000000..ed50525e0 Binary files /dev/null and b/test/pdfs/issue17065.pdf differ diff --git a/test/test_manifest.json b/test/test_manifest.json index e3236b608..7d92433fb 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -8149,5 +8149,12 @@ "rounds": 1, "type": "eq", "annotations": true + }, + { + "id": "issue17065", + "file": "pdfs/issue17065.pdf", + "md5": "16a70b9941ba049a61612109e0e1d719", + "rounds": 1, + "type": "eq" } ]