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.
This commit is contained in:
dotCooCoo
2026-10-29 10:01:53 +07:00
committed by bflatastic
parent 7e25203660
commit 46721fe093
2 changed files with 6 additions and 0 deletions
+2
View File
@@ -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;
+4
View File
@@ -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);