From 82788b7a68d6d8404512c3ada07cb56c39390b72 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 10 Oct 2026 21:28:25 +0000 Subject: [PATCH] Multi-layer edits: only a real drag offsets the other layers; the Timeline stopwatch stays per property (#355, #491 follow-up) A typed value committed by clicking elsewhere could be applied as an offset, because dragged_id() is set on the press that commits it; a scrub now needs a decided drag. In the Timeline, clicking a stopwatch or the keyframe button acts on that layer's property only, as in After Effects (the Properties panel and keyboard shortcuts act on every selected layer). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01QiAJeFttZp83Fh7YuzAR5f --- crates/ui-egui/src/panels/effect_controls.rs | 2 +- crates/ui-egui/src/panels/properties.rs | 2 +- crates/ui-egui/src/panels/timeline.rs | 9 ++++----- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/crates/ui-egui/src/panels/effect_controls.rs b/crates/ui-egui/src/panels/effect_controls.rs index d5edc667..b4f40c1f 100644 --- a/crates/ui-egui/src/panels/effect_controls.rs +++ b/crates/ui-egui/src/panels/effect_controls.rs @@ -274,7 +274,7 @@ fn prop_row( app.auto.add(&format!("effectControls.prop.{uid}.name"), name_clip, &prop.name); let merge = format!("ec-{uid}"); // With several layers selected the edit applies to the same effect property of each (#491). - let scrub = ui.ctx().dragged_id().is_some(); + let scrub = ui.ctx().dragged_id().is_some() && ui.input(|i| i.pointer.is_decidedly_dragging()); let set = |actions: &mut Actions, v: serde_json::Value| { actions.push(("prop.set".into(), json!({"layer": layer.id.0, "prop": uid, "value": v, "merge": merge, "selected": true, "offset": scrub}))) }; diff --git a/crates/ui-egui/src/panels/properties.rs b/crates/ui-egui/src/panels/properties.rs index c10d29bb..e565034e 100644 --- a/crates/ui-egui/src/panels/properties.rs +++ b/crates/ui-egui/src/panels/properties.rs @@ -247,7 +247,7 @@ fn transform_row(app: &mut EffectcraftApp, ui: &mut egui::Ui, p: &egui::Painter, let merge = format!("props-{uid}"); // With several layers selected the edit applies to all: a scrub by the same change, a typed // value as it is. - let scrub = ui.ctx().dragged_id().is_some(); + let scrub = ui.ctx().dragged_id().is_some() && ui.input(|i| i.pointer.is_decidedly_dragging()); let set = |actions: &mut Actions, v: serde_json::Value| { actions.push(("prop.set".into(), json!({"layer": lid, "prop": uid, "value": v, "merge": merge, "selected": true, "offset": scrub}))) }; diff --git a/crates/ui-egui/src/panels/timeline.rs b/crates/ui-egui/src/panels/timeline.rs index fb074bcc..41402cce 100644 --- a/crates/ui-egui/src/panels/timeline.rs +++ b/crates/ui-egui/src/panels/timeline.rs @@ -2403,7 +2403,7 @@ pub fn show(app: &mut EffectcraftApp, ui: &mut egui::Ui, rect: Rect) { ui_actions.push(UiAct::SetTime(layer.comp_time(k.time))); } if ui.interact(mid, egui::Id::new(("kmid", uid)), Sense::click()).clicked() { - actions.push(("prop.toggleKey".into(), json!({"layer": layer.id.0, "prop": uid, "selected": true}))); + actions.push(("prop.toggleKey".into(), json!({"layer": layer.id.0, "prop": uid}))); } app.auto.add(&format!("timeline.prop.{uid}.addKey"), mid, "Add or remove keyframe"); } @@ -2426,11 +2426,10 @@ pub fn show(app: &mut EffectcraftApp, ui: &mut egui::Ui, rect: Rect) { actions.push(("prop.setExpression".into(), json!({"layer": layer.id.0, "prop": uid}))); } } else if let Some((value, merge)) = switch_gesture(ui, &resp, r, "stopwatch", prop.is_animated()) { - actions - .push(("prop.toggleAnimation".into(), json!({"layer": layer.id.0, "prop": uid, "value": value, "merge": merge, "selected": true}))); + actions.push(("prop.toggleAnimation".into(), json!({"layer": layer.id.0, "prop": uid, "value": value, "merge": merge}))); } else if resp.clicked() && !resp.clicked_by(egui::PointerButton::Primary) { // Keyboard or accessibility activation. - actions.push(("prop.toggleAnimation".into(), json!({"layer": layer.id.0, "prop": uid, "selected": true}))); + actions.push(("prop.toggleAnimation".into(), json!({"layer": layer.id.0, "prop": uid}))); } } let name_x = indent + 12.0; @@ -3513,7 +3512,7 @@ fn value_editor( let merge = format!("scrub-{uid}"); // With several layers selected the edit applies to all of them (#491): a scrub by the same // change, a typed value as it is. - let scrub = ui.ctx().dragged_id().is_some(); + let scrub = ui.ctx().dragged_id().is_some() && ui.input(|i| i.pointer.is_decidedly_dragging()); let set = |actions: &mut Vec<(String, serde_json::Value)>, v: serde_json::Value| { actions.push(("prop.set".into(), json!({"layer": layer.id.0, "prop": uid, "value": v, "merge": merge, "selected": true, "offset": scrub}))) };