Graph editor: speed graph handles keep dragging once their key leaves the plot (fixes #1171)

This commit is contained in:
Marco Arnulfo
2026-10-13 03:47:24 +02:00
parent 470ea7a3af
commit 3db5aebb33
2 changed files with 32 additions and 1 deletions
+4 -1
View File
@@ -376,7 +376,10 @@ pub(crate) fn show(app: &mut EffectcraftApp, ui: &mut egui::Ui, p: &egui::Painte
let (lid, uid, d) = (c.layer.id, c.prop.uid, c.dim);
for k in &c.keys {
let kp = pos2(tm.x(k.t), ymap(k.v));
if !plot.expand(6.0).contains(kp) {
// In the speed graph an end key rises with the handle being dragged; skipping it once it
// leaves the plot would drop the handle's widget and end the drag at the top edge.
let handle_dragged = || ["in", "out"].iter().any(|side| ctx.is_being_dragged(egui::Id::new(("ghandle", uid, d, k.idx, *side))));
if !plot.expand(6.0).contains(kp) && !handle_dragged() {
continue;
}
let kjson = json!({"layer": lid.0, "prop": uid, "time": k.time.seconds()});