Store each comp's layer selection on its own.

A single selected_layers list kept ids from every comp, so the active comp looked selected whenever another comp was. Opening a comp and running a script against a different comp now park and restore that selection.
This commit is contained in:
Vikram Bhaskaran
2026-10-13 17:46:02 +11:00
parent 8c986a1bec
commit c46f80faa2
5 changed files with 123 additions and 23 deletions
+2 -2
View File
@@ -151,7 +151,7 @@ pub(crate) fn exec(s: &mut Session, id: &str, params: J) -> Result<J, String> {
if let Some(c) = target
&& prev != Some(c)
{
s.state.active_comp = Some(c);
s.activate_comp(c);
}
if CREATES_LAYER.contains(&id) {
s.state.selected_layers.clear();
@@ -163,7 +163,7 @@ pub(crate) fn exec(s: &mut Session, id: &str, params: J) -> Result<J, String> {
&& id != "comp.open"
{
match prev {
Some(p) if s.project.comp(p).is_some() => s.state.active_comp = Some(p),
Some(p) if s.project.comp(p).is_some() => s.activate_comp(p),
_ => {
if !s.state.open_comps.contains(&c) {
s.state.open_comps.push(c);