Adjust the heuristics used when dealing with rectangles, i.e. re operators, with zero width/height (issue 12010)

This commit is contained in:
Jonas Jenwald 2020-06-30 12:18:06 +02:00
parent 75fed02630
commit fef24658e7
4 changed files with 15 additions and 8 deletions

View File

@ -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++];

View File

@ -262,6 +262,7 @@
!bug903856.pdf
!bug850854.pdf
!bug866395.pdf
!issue12010_reduced.pdf
!issue11718_reduced.pdf
!bug1027533.pdf
!bug1028735.pdf

Binary file not shown.

View File

@ -2727,6 +2727,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",