mirror of
https://github.com/storytold/figcraft.git
synced 2026-11-30 18:24:11 +01:00
M3, #2567: a text run's blend fill in a shadowed pass-through frame blends with the backdrop
This commit is contained in:
1 file changed
+3
-2
@@ -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<Vec<Paint>>| 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
|
||||
|
||||
Reference in new issue
Block a user