Skip to content

Commit 7f151c7

Browse files
authored
Merge pull request #21262 from calixteman/issue18032
Fix nested non-isolated groups in knockout rendering
2 parents 0e0f7b7 + 0e335d5 commit 7f151c7

4 files changed

Lines changed: 14 additions & 3 deletions

File tree

src/display/canvas.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3341,13 +3341,15 @@ class CanvasGraphics {
33413341
// #compositeKnockoutSurface so it doesn't become part of the group
33423342
// source itself.
33433343
const backdropCtx = group.knockout && !group.isolated ? currentCtx : null;
3344-
// Non-isolated non-KO subgroup inside a KO parent: at endGroup we'll
3345-
// blend its elements against the outer KO running canvas (also frozen),
3346-
// so just record the flag here and read ctx.canvas at composite time.
3344+
// Non-isolated non-KO subgroup inside a KO parent, with inner compositing
3345+
// of its own: at endGroup we'll blend its elements against the outer KO
3346+
// running canvas (also frozen), so just record the flag here and read
3347+
// ctx.canvas at composite time.
33473348
const hasInnerBackdrop =
33483349
!group.isolated &&
33493350
!group.knockout &&
33503351
!group.smask &&
3352+
group.needsIsolation &&
33513353
this.#knockoutGroupLevel > 0;
33523354

33533355
// Pool the per-element shape mask for the lifetime of this KO group.

test/pdfs/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -920,3 +920,4 @@
920920
!smask_luminosity_oob_transfer.pdf
921921
!operator_list_cycle.pdf
922922
!knockout_groups_test.pdf
923+
!issue18032.pdf

test/pdfs/issue18032.pdf

101 KB
Binary file not shown.

test/test_manifest.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14252,5 +14252,13 @@
1425214252
"rounds": 1,
1425314253
"type": "eq",
1425414254
"about": "Knockout groups composite-modes survey."
14255+
},
14256+
{
14257+
"id": "issue18032",
14258+
"file": "pdfs/issue18032.pdf",
14259+
"md5": "656234fde97953c4e3fc7698831590a9",
14260+
"rounds": 1,
14261+
"type": "eq",
14262+
"about": "Non-isolated knockout group with a nested non-isolated subgroup over existing text."
1425514263
}
1425614264
]

0 commit comments

Comments
 (0)