1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

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