From 79b3a8fbd40823853a42773d2a4fa32f92c30050 Mon Sep 17 00:00:00 2001 From: Mike Solar Date: Fri, 21 Aug 2026 04:42:30 +0800 Subject: [PATCH] feat(widgets): CurveEditor::is_dragging for host re-sync suppression --- crates/gpui_widgets/src/curve_editor/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/gpui_widgets/src/curve_editor/mod.rs b/crates/gpui_widgets/src/curve_editor/mod.rs index f3885af9fa..a9a2e04feb 100644 --- a/crates/gpui_widgets/src/curve_editor/mod.rs +++ b/crates/gpui_widgets/src/curve_editor/mod.rs @@ -116,6 +116,12 @@ impl CurveEditor { &self.points } + /// Whether a point/handle drag is in progress (hosts must not push a + /// `set_points` re-sync mid-drag — it would steal the gesture). + pub fn is_dragging(&self) -> bool { + self.pending_drag.is_some() + } + /// Apply the host's reconciled curve and repaint. pub fn set_points(&mut self, points: Vec, cx: &mut Context) { self.points = points;