mirror of
https://github.com/storytold/effectcraft.git
synced 2026-10-26 19:18:14 -06:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user