Effect reset: restore parameters inside twirl-down groups
effect.reset looked parameters up by their full spec id among the effect's direct children, so every 'group/param' id (most of Fractal, Scribble, and other grouped effects) was skipped and Reset did nothing for them. Fixes #526 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
813c7c4650
commit
00156ce22e
@@ -387,7 +387,8 @@ fn reset(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
s.edit(&format!("Reset {name}"), None, |proj, _| {
|
||||
let g = layer_mut(proj, cid, lid)?.props.find_group_mut(uid).ok_or_else(|| bad("effect.reset", "gone"))?;
|
||||
for ps in &spec.params {
|
||||
if let Some(pr) = g.get_mut(ps.id) {
|
||||
// (`group/param` ids live in twirl-down groups.)
|
||||
if let Some(pr) = g.prop_mut(ps.id) {
|
||||
pr.set_value_at(lt, effectcraft_effects::default_value(ps, size));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user