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