Reset transfer functions when entering in a new group

It fixes #20722.
This commit is contained in:
calixteman 2026-02-23 22:31:13 +01:00
parent 909a700afa
commit 15e7a551ab
No known key found for this signature in database
GPG Key ID: 0C5442631EE0691F
4 changed files with 17 additions and 0 deletions

View File

@ -903,6 +903,11 @@ class PartialEvaluator {
let transferArray; let transferArray;
if (Array.isArray(tr)) { if (Array.isArray(tr)) {
transferArray = tr; transferArray = tr;
if (tr.length > 1 && tr.every(map => map === tr[0])) {
// All entries in the array are the same, so we can just use one of
// them.
transferArray = [tr[0]];
}
} else if (isPDFFunction(tr)) { } else if (isPDFFunction(tr)) {
transferArray = [tr]; transferArray = [tr];
} else { } else {

View File

@ -2668,6 +2668,7 @@ class CanvasGraphics {
["BM", "source-over"], ["BM", "source-over"],
["ca", 1], ["ca", 1],
["CA", 1], ["CA", 1],
["TR", null],
]); ]);
this.groupStack.push(currentCtx); this.groupStack.push(currentCtx);
this.groupLevel++; this.groupLevel++;

View File

@ -0,0 +1 @@
https://github.com/user-attachments/files/25484709/get1d.pdf

View File

@ -13954,5 +13954,15 @@
"link": true, "link": true,
"lastPage": 1, "lastPage": 1,
"type": "eq" "type": "eq"
},
{
"id": "issue20722",
"file": "pdfs/issue20722.pdf",
"md5": "4a2e58e60973af3004dcfe1ff0be833c",
"rounds": 1,
"link": true,
"firstPage": 171,
"lastPage": 171,
"type": "eq"
} }
] ]