Timeline: dragging over stopwatches sets them all (#284)
As in After Effects, pressing a property's stopwatch toggles it, and dragging on over the stopwatches above or below gives every property the pointer passes the state the first one got (animated or not), whatever its own, in one undo step. Alt+click still adds an expression. The gesture is the layer switches' press-and-drag from #238, moved into `switch_gesture` and shared by both. `prop.toggleAnimation` takes `merge` so the drag folds into one undo step. Tests: dragging_over_stopwatches_sets_them_all (ui_timeline_switches), stopwatch_toggles_with_a_merge_key_are_one_undo_step (engine). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
2eb56cff1c
commit
59c55e8a26
@@ -428,6 +428,19 @@ fn parenting_keeps_the_layer_in_place() {
|
||||
assert!(s.active_comp().unwrap().layer(effectcraft_project::LayerId(child)).unwrap().parent.is_some());
|
||||
}
|
||||
|
||||
/// #284: toggling stopwatches with one `merge` key (dragging over them) is one undo step.
|
||||
#[test]
|
||||
fn stopwatch_toggles_with_a_merge_key_are_one_undo_step() {
|
||||
let (mut s, l) = setup();
|
||||
let steps = s.history.undo.len();
|
||||
for path in ["transform/position", "transform/scale", "transform/opacity"] {
|
||||
s.execute("prop.toggleAnimation", json!({"layer": l, "path": path, "value": true, "merge": "drag"})).unwrap();
|
||||
}
|
||||
assert_eq!(s.history.undo.len(), steps + 1);
|
||||
s.execute("edit.undo", json!({})).unwrap();
|
||||
assert!(["transform/position", "transform/scale", "transform/opacity"].iter().all(|p| !prop(&s, l, p).is_animated()));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn pick_whip_generates_ae_reference_expressions() {
|
||||
let (mut s, l) = setup();
|
||||
|
||||
Reference in New Issue
Block a user