mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-07-27 09:27:20 +02:00
Correctly compute the bbox when simplifying the path construction
It fixes #21126.
This commit is contained in:
parent
3ccb263857
commit
db89d3a0e6
@ -15,6 +15,7 @@
|
|||||||
|
|
||||||
import {
|
import {
|
||||||
DrawOPS,
|
DrawOPS,
|
||||||
|
F32_BBOX_INIT,
|
||||||
ImageKind,
|
ImageKind,
|
||||||
OPS,
|
OPS,
|
||||||
RenderingIntentFlag,
|
RenderingIntentFlag,
|
||||||
@ -520,7 +521,9 @@ addState(
|
|||||||
const [, [buffer], minMax] = args;
|
const [, [buffer], minMax] = args;
|
||||||
|
|
||||||
if (minMax) {
|
if (minMax) {
|
||||||
Util.scaleMinMax(transform, minMax);
|
const newBBox = F32_BBOX_INIT.slice();
|
||||||
|
Util.axialAlignedBoundingBox(minMax, transform, newBBox);
|
||||||
|
minMax.set(newBBox);
|
||||||
for (let k = 0, kk = buffer.length; k < kk; ) {
|
for (let k = 0, kk = buffer.length; k < kk; ) {
|
||||||
switch (buffer[k++]) {
|
switch (buffer[k++]) {
|
||||||
case DrawOPS.moveTo:
|
case DrawOPS.moveTo:
|
||||||
|
|||||||
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
@ -904,3 +904,4 @@
|
|||||||
!three_pages_with_number.pdf
|
!three_pages_with_number.pdf
|
||||||
!issue13520.pdf
|
!issue13520.pdf
|
||||||
!22060_A1_01_Plans.pdf
|
!22060_A1_01_Plans.pdf
|
||||||
|
!issue21126.pdf
|
||||||
|
|||||||
BIN
test/pdfs/issue21126.pdf
Normal file
BIN
test/pdfs/issue21126.pdf
Normal file
Binary file not shown.
@ -14136,5 +14136,12 @@
|
|||||||
"firstPage": 3,
|
"firstPage": 3,
|
||||||
"lastPage": 3,
|
"lastPage": 3,
|
||||||
"type": "eq"
|
"type": "eq"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "issue21126",
|
||||||
|
"file": "pdfs/issue21126.pdf",
|
||||||
|
"md5": "29c23022ab3d983733e1ee37fd0bc785",
|
||||||
|
"rounds": 1,
|
||||||
|
"type": "eq"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user