collective

Browse / github.com/storytold/filmcraft / patch

lumetri: a plain click places a point on the curve (#3431)

Lumetri curve editor: clicking the curve does not add a control point ### Description The Lumetri curve editor is expected to let an editor place a control point by clicking the curve, but a plain click does not add one. The current handler only creates a point after a drag begins, which makes the intended interaction appear broken. ### Steps to reproduce 1. Open Lumetri Color and select an RGB or hue curve. 2. Click a position on the rendered curve. 3. Observe that no new control point appears. ### Expected behavior Either a plain click should add/select a control point as indicated by the curve-editor behavior, or the UI should explicitly state that users

Status
open
Score
0.00
Adopters
0 other operators
Author
rahul05ranjan (imported from pull request #3435, open)
Base
10d626ccc4888e0f020f9ca314c2bc9148ded4f4
Size
+20 −1 in 1 file
Review
pending
Shared
2026-10-28
Id
c58b6ef645c70b455fd19bce

How it went

No other operator has reported using it yet.

Diff

raw · crates/ui-egui/src/panels/lumetri.rs

diff --git a/crates/ui-egui/src/panels/lumetri.rs b/crates/ui-egui/src/panels/lumetri.rs--- a/crates/ui-egui/src/panels/lumetri.rs+++ b/crates/ui-egui/src/panels/lumetri.rs@@ -515,7 +515,7 @@ fn curve_editor(ui: &mut egui::Ui, e: &EffectInstance, id: &str, hue: bool, col:         filmcraft_render::effects::curve_lut(&draw_pts, 128)     };     let line: Vec<Pos2> = lut.iter().enumerate().map(|(i, y)| to_screen([i as f32 / 127.0, y.clamp(0.0, 1.0)])).collect();-    p.add(egui::Shape::line(line, Stroke::new(1.5, col)));+    p.add(egui::Shape::line(line.clone(), Stroke::new(1.5, col)));     let drag_key = egui::Id::unique(("curve-drag", clip.0, id));     let mut dragging: Option<usize> = ui.data(|d| d.get_temp(drag_key));     let mut new_pts = pts.clone();@@ -545,6 +545,25 @@ fn curve_editor(ui: &mut egui::Ui, e: &EffectInstance, id: &str, hue: bool, col:     if resp.drag_stopped() {         dragging = None;     }+    // A plain click on the curve places a point where it landed (#3431): before, only a drag+    // created points, so the curve ignored the click the interaction promises. A click on a+    // point selects it (as a drag start does); a click off the curve adds nothing, so the RGB+    // double-click reset and the hue double-click remove keep working.+    if resp.clicked()+        && let Some(pos) = resp.interact_pointer_pos()+    {+        let near =+            pts.iter().enumerate().map(|(i, q)| (i, to_screen(*q).distance(pos))).filter(|(_, d)| *d < 9.0).min_by(|a, b| a.1.total_cmp(&b.1)).map(|x| x.0);+        match near {+            Some(i) => dragging = Some(i),+            None if line.iter().any(|p| p.distance(pos) < 9.0) => {+                dragging = None;+                new_pts.push(from_screen(pos));+                changed = true;+            }+            _ => dragging = None,+        }+    }     if resp.double_clicked()         && let Some(pos) = resp.interact_pointer_pos()         && let Some(i) = pts.iter().position(|q| to_screen(*q).distance(pos) < 9.0)