From 1dbea4b552f6ef3376fa3d3c255566e2dbfa22b6 Mon Sep 17 00:00:00 2001 From: hoangquocvietuet Date: Sun, 29 Nov 2026 15:56:50 +0000 Subject: [PATCH] M3, #2567: a text run's blend fill in a shadowed pass-through frame blends with the backdrop --- crates/render/src/draw.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/render/src/draw.rs b/crates/render/src/draw.rs index 79b996a39..38ad5dfe9 100644 --- a/crates/render/src/draw.rs +++ b/crates/render/src/draw.rs @@ -1101,13 +1101,14 @@ fn blends_through(doc: &Document, n: &Node, backdrop: bool) -> bool { }) } -/// Whether one of `n`'s own paints (fills, strokes, a vector region's fills) is in a blend mode -/// of its own. +/// Whether one of `n`'s own paints (fills, strokes, region fills, text and run fills) has a blend mode of its own. fn paints_blend(n: &Node) -> bool { let own = |p: &Paint| p.visible && !matches!(p.blend, BlendMode::Normal | BlendMode::PassThrough); + let fills = |f: &Option>| f.as_deref().is_some_and(|f| f.iter().any(own)); n.fills.iter().any(own) || n.strokes.iter().any(own) || region_painted(n).is_some_and(|net| net.regions.iter().any(|r| r.fills.as_deref().is_some_and(|f| f.iter().any(own)))) + || matches!(&n.kind, NodeKind::Text(t) if fills(&t.style.fills) || t.runs.iter().any(|r| fills(&r.style.fills))) } /// Node `n`'s backdrop effects through its backdrop outline `sh`, for its `size` layer at `at` on