From 146d30502a558e7fbf3cd0809f4fbebf1cbd7b6f Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 3 Nov 2026 21:31:47 -0800 Subject: [PATCH] Expand: selected symbol instances become their art, as Break Link places it Object > Expand with Object on now turns each symbol instance in the selection, including one in a selected group or in a placed document's art, into its art, as Break Link to Symbol places it. It goes one level deep: the instances in that art stay instances. The art keeps the instance's id and place in the stacking order, and Expand stays one undo step. - Instances with effects stay instances, and Expand Appearance bakes them as before. Instances with an effect on a fill or stroke, instances in perspective, and those in blends, repeats and Intertwine groups stay instances. - The art keeps the instance's opacity mask, as Break Link gives it. - A hidden or locked instance's art stays hidden or locked. - A placed document in an instance's art is expanded too. - When the instances' art would make more than 1,000,000 objects, they stay instances, the limit Break Link uses. - The Fill and Stroke options (object.expand.info, and the Expand dialog) count the fills, strokes and gradients in the art of those instances, with a dynamic instance's own changes applied. The info reports under symbolArt which of them only that art holds, and the dialog enables those options only while Object is on. --- crates/engine/src/cmd/brushsym.rs | 4 +- crates/engine/src/cmd/brushsym/symbols.rs | 59 ++++- crates/engine/src/cmd/expand.rs | 124 ++++++--- crates/engine/src/tests.rs | 1 + crates/engine/src/tests/expand_symbols.rs | 286 +++++++++++++++++++++ crates/engine/src/tests/placed_document.rs | 18 ++ crates/ui-egui/src/dialogs/expand.rs | 36 ++- docs/control-protocol.md | 4 +- docs/mcp.md | 10 +- docs/target-app-parity.md | 4 +- 10 files changed, 503 insertions(+), 43 deletions(-) create mode 100644 crates/engine/src/tests/expand_symbols.rs diff --git a/crates/engine/src/cmd/brushsym.rs b/crates/engine/src/cmd/brushsym.rs index f34ae619d..f5da40e7b 100644 --- a/crates/engine/src/cmd/brushsym.rs +++ b/crates/engine/src/cmd/brushsym.rs @@ -35,7 +35,9 @@ use brushes::{ }; use dynamic::{symbol_instance_reset, symbol_instance_set_appearance}; use symbols::selected_instances; -pub(crate) use symbols::{instance_in_place, natural_size, normalize, place_xf, set_natural_size, store_symbol}; +pub(crate) use symbols::{ + expand_instances_under, expandable_instances, instance_in_place, natural_size, normalize, place_xf, set_natural_size, store_symbol, +}; use symbols::{ symbol_adjust, symbol_break_link, symbol_delete, symbol_duplicate, symbol_list, symbol_new, symbol_options, symbol_place, symbol_replace, symbol_select_instances, symbol_set_current, symbol_spray, symbol_unused, symbol_update, diff --git a/crates/engine/src/cmd/brushsym/symbols.rs b/crates/engine/src/cmd/brushsym/symbols.rs index 534b51506..3bc167ffa 100644 --- a/crates/engine/src/cmd/brushsym/symbols.rs +++ b/crates/engine/src/cmd/brushsym/symbols.rs @@ -412,7 +412,64 @@ fn break_links(d: &mut Document, ids: &[NodeId], own: bool) -> Result