Symbols: Direct Selection sets the solid fill and stroke of one object in a dynamic instance

Squashed from #5962 onto main.
This commit is contained in:
dotCooCoo
2026-11-09 00:26:11 +07:00
committed by bflatastic
parent 122b10143c
commit 434c032f9e
78 changed files with 2198 additions and 106 deletions
+4 -1
View File
@@ -189,8 +189,10 @@ fn has_selection_or_ids(s: &Session) -> std::result::Result<(), String> {
has_doc(s)
}
/// The repeats of the selection: selected ones, and those around a selected object. None while
/// an object of a dynamic symbol instance's art is selected.
fn selected_repeats(s: &Session) -> Vec<NodeId> {
let Some(st) = s.active() else { return vec![] };
let Some(st) = s.active().filter(|st| st.selection.symbol_part.is_none()) else { return vec![] };
let mut out = vec![];
for id in &st.selection.objects {
for a in st.doc.ancestry(*id).unwrap_or_default().into_iter().rev() {
@@ -207,6 +209,7 @@ fn selected_repeats(s: &Session) -> Vec<NodeId> {
fn has_repeat(s: &Session) -> std::result::Result<(), String> {
has_selection(s)?;
super::edit::no_symbol_part(s)?;
if selected_repeats(s).is_empty() { Err("select a repeat".into()) } else { Ok(()) }
}