diff --git a/src/display/canvas.js b/src/display/canvas.js index bdfb16f405501b..d3f783dab4359a 100644 --- a/src/display/canvas.js +++ b/src/display/canvas.js @@ -1185,20 +1185,20 @@ var CanvasGraphics = (function CanvasGraphicsClosure() { y = args[j++]; var width = args[j++]; var height = args[j++]; - if (width === 0) { + if (width === 0 && ctx.lineWidth < this.getSinglePixelWidth()) { width = this.getSinglePixelWidth(); } - if (height === 0) { + if (height === 0 && ctx.lineWidth < this.getSinglePixelWidth()) { height = this.getSinglePixelWidth(); } var xw = x + width; var yh = y + height; - this.ctx.moveTo(x, y); - this.ctx.lineTo(xw, y); - this.ctx.lineTo(xw, yh); - this.ctx.lineTo(x, yh); - this.ctx.lineTo(x, y); - this.ctx.closePath(); + ctx.moveTo(x, y); + ctx.lineTo(xw, y); + ctx.lineTo(xw, yh); + ctx.lineTo(x, yh); + ctx.lineTo(x, y); + ctx.closePath(); break; case OPS.moveTo: x = args[j++]; diff --git a/test/pdfs/.gitignore b/test/pdfs/.gitignore index d235d1f378df99..44c50058f7f29b 100644 --- a/test/pdfs/.gitignore +++ b/test/pdfs/.gitignore @@ -262,6 +262,7 @@ !bug903856.pdf !bug850854.pdf !bug866395.pdf +!issue12010_reduced.pdf !issue11718_reduced.pdf !bug1027533.pdf !bug1028735.pdf diff --git a/test/pdfs/issue12010_reduced.pdf b/test/pdfs/issue12010_reduced.pdf new file mode 100644 index 00000000000000..7294c93b33674e Binary files /dev/null and b/test/pdfs/issue12010_reduced.pdf differ diff --git a/test/test_manifest.json b/test/test_manifest.json index 1b8d4b51eb79be..fc060ebd1d84b3 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -2720,6 +2720,12 @@ "link": false, "type": "eq" }, + { "id": "issue12010", + "file": "pdfs/issue12010_reduced.pdf", + "md5": "8894ec63069dcf92c9f56baec05c0425", + "rounds": 1, + "type": "eq" + }, { "id": "issue7598", "file": "pdfs/issue7598.pdf", "md5": "c5bc5a779bfcb4b234f853231b56cf60",