From 46721fe0934619f0f38dd558989f8a269ae13150 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 28 Oct 2026 01:15:07 -0700 Subject: [PATCH] Blob Brush: a release away from the press point paints with Alt down A release that arrives at a new position with no drag before it now counts as movement, so Alt pressed at that moment no longer switches the stroke to the Smooth tool. --- crates/tools/src/draw2/gesture.rs | 2 ++ crates/tools/src/draw2/gesture/tests.rs | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/crates/tools/src/draw2/gesture.rs b/crates/tools/src/draw2/gesture.rs index 57a3293ff..ee01a4e34 100644 --- a/crates/tools/src/draw2/gesture.rs +++ b/crates/tools/src/draw2/gesture.rs @@ -519,6 +519,8 @@ impl Tool for GestureTool { if !self.active { return vec![]; } + // A release away from the press point counts as movement. + self.moved |= self.points.first().is_some_and(|start| p.distance(*start) > vectorcraft_geom::EPS); // Alt pressed while the pointer stood still at the press point switches the release too. if self.blob_alt_smooths(ev.mods) { self.smoothing = true; diff --git a/crates/tools/src/draw2/gesture/tests.rs b/crates/tools/src/draw2/gesture/tests.rs index 59112ab9c..653efb6cf 100644 --- a/crates/tools/src/draw2/gesture/tests.rs +++ b/crates/tools/src/draw2/gesture/tests.rs @@ -409,6 +409,10 @@ fn blob_brush_alt_switches_to_the_smooth_tool() { assert_eq!(t.cursor(&cx, at, alt), Cursor::Smooth); let acts = t.pointer(&cx, &PointerEvent::new(PointerKind::Up, 50.0, 150.0).with_mods(alt)); assert!(acts.is_empty(), "{acts:?}"); + // A release away from the press point with no drag before it paints when Alt goes down. + t.pointer(&cx, &PointerEvent::new(PointerKind::Down, 50.0, 150.0)); + let acts = t.pointer(&cx, &PointerEvent::new(PointerKind::Up, 150.0, 150.0).with_mods(alt)); + assert!(matches!(acts.as_slice(), [Action::Exec(c, _)] if c == "path.blob"), "{acts:?}"); // With nothing selected an Alt drag sends nothing. let none = Selection::default(); let empty = crate::testutil::cx(&d, &none, &p);