Merge pull request #7839 from dotCooCoo/fix/expand-appearance-nested-instance-effects

Expand Appearance: raster effects on a symbol instance's fill or stroke expand to art, nested instances included
This commit is contained in:
BFlat
2026-11-16 10:35:50 +07:00
committed by GitHub
33 changed files with 659 additions and 96 deletions
+2 -2
View File
@@ -87,8 +87,8 @@ pub use raster::{
};
pub use reshape::{
SYMBOL_ART_MAX_NODES, expand_outlined, follows_image_pixels, gives_image_shape, has_gradient_copies, has_instance_row_raster, has_item_geometry,
has_painted_effects, has_transform_art, has_transform_copies, has_transform_options, image_paint, needs_outline, outer_effects, outline_art,
outline_text, paint_type_piece, reshape,
has_painted_effects, has_transform_art, has_transform_copies, has_transform_options, image_paint, instance_as_art, needs_outline, outer_effects,
outline_art, outline_text, paint_type_piece, reshape,
};
pub use revolve::{
CLASSIC_REVOLVE, REVOLVE, has_revolve, is_revolve, revolve_art, revolve_art_in, revolve_options, validate_revolve, validate_revolve_in,
+10
View File
@@ -900,6 +900,16 @@ pub fn expand_outlined(doc: Option<&Document>, n: &Node, symbol_art: Option<&Nod
as_art(doc, n, symbol_art)
}
/// Symbol instance `n` as plain art for Expand Appearance, with or without geometry effects: the
/// art it places, reshaped by those effects when it has some, in the form [`expand_outlined`]
/// gives. `None` for other kinds of objects and for an instance without `symbol_art`.
pub fn instance_as_art(doc: Option<&Document>, n: &Node, symbol_art: Option<&Node>) -> Option<Node> {
if !matches!(n.kind, NodeKind::SymbolInstance { .. }) {
return None;
}
as_art(doc, n, symbol_art)
}
/// [`reshape`] without its checks (no geometry effects: just the art).
pub(crate) fn as_art(doc: Option<&Document>, n: &Node, symbol_art: Option<&Node>) -> Option<Node> {
as_art_with(doc, doc, n, symbol_art, &outline_text, &SymbolNodes::default())