Ignore empty paths when optimizing constructPath operations (issue 19971)
Note how we're handling empty paths in [src/display/canvas.js](a8e05d82e2/src/display/canvas.js (L1423-L1428)), hence we need add similar code in the `QueueOptimizer` as well.
This commit is contained in:
parent
a8e05d82e2
commit
c5449a98e0
@ -519,18 +519,20 @@ addState(
|
|||||||
const transform = argsArray[iFirstTransform];
|
const transform = argsArray[iFirstTransform];
|
||||||
const [, [buffer], minMax] = args;
|
const [, [buffer], minMax] = args;
|
||||||
|
|
||||||
Util.scaleMinMax(transform, minMax);
|
if (minMax) {
|
||||||
for (let k = 0, kk = buffer.length; k < kk; ) {
|
Util.scaleMinMax(transform, minMax);
|
||||||
switch (buffer[k++]) {
|
for (let k = 0, kk = buffer.length; k < kk; ) {
|
||||||
case DrawOPS.moveTo:
|
switch (buffer[k++]) {
|
||||||
case DrawOPS.lineTo:
|
case DrawOPS.moveTo:
|
||||||
Util.applyTransform(buffer, transform, k);
|
case DrawOPS.lineTo:
|
||||||
k += 2;
|
Util.applyTransform(buffer, transform, k);
|
||||||
break;
|
k += 2;
|
||||||
case DrawOPS.curveTo:
|
break;
|
||||||
Util.applyTransformToBezier(buffer, transform, k);
|
case DrawOPS.curveTo:
|
||||||
k += 6;
|
Util.applyTransformToBezier(buffer, transform, k);
|
||||||
break;
|
k += 6;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Replace queue items.
|
// Replace queue items.
|
||||||
|
|||||||
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
@ -622,6 +622,7 @@
|
|||||||
!bug1815476.pdf
|
!bug1815476.pdf
|
||||||
!issue16021.pdf
|
!issue16021.pdf
|
||||||
!bug1770750.pdf
|
!bug1770750.pdf
|
||||||
|
!issue19971.pdf
|
||||||
!issue16063.pdf
|
!issue16063.pdf
|
||||||
!issue19389.pdf
|
!issue19389.pdf
|
||||||
!issue16067.pdf
|
!issue16067.pdf
|
||||||
|
|||||||
BIN
test/pdfs/issue19971.pdf
Normal file
BIN
test/pdfs/issue19971.pdf
Normal file
Binary file not shown.
@ -4142,6 +4142,14 @@
|
|||||||
"lastPage": 1,
|
"lastPage": 1,
|
||||||
"type": "eq"
|
"type": "eq"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "issue19971",
|
||||||
|
"file": "pdfs/issue19971.pdf",
|
||||||
|
"md5": "2eb897b3ef3342bfc5ad31886e7cd1fe",
|
||||||
|
"rounds": 1,
|
||||||
|
"lastPage": 1,
|
||||||
|
"type": "eq"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "issue8702-text",
|
"id": "issue8702-text",
|
||||||
"file": "pdfs/issue8702.pdf",
|
"file": "pdfs/issue8702.pdf",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user