Keep Bristle tip in sync with Alt release

This commit is contained in:
dotCooCoo
2026-11-17 18:01:35 -08:00
parent e3672e958b
commit 0637f14bfd
2 changed files with 15 additions and 0 deletions
+4
View File
@@ -1798,6 +1798,10 @@ impl Tool for GestureTool {
self.close_to = None;
self.connect_to.clear();
self.redraw = None;
if self.id == "paintbrush" {
// The release can change a drawing stroke into an Alt-borrowed Smooth hover.
self.pointer_tip(cx, ev);
}
out
}
_ => vec![],
+11
View File
@@ -3099,6 +3099,17 @@ fn bristle_tip_annotator_follows_a_rotation_capable_pen() {
let mut release = heavy;
release.kind = PointerKind::Up;
tool.pointer(&view, &release);
let mut alt_stroke = light;
alt_stroke.pressure = 0.5;
tool.pointer(&selected_view, &alt_stroke);
alt_stroke.kind = PointerKind::Drag;
alt_stroke.mods.alt = true;
tool.pointer(&selected_view, &alt_stroke);
assert!(bounds(&tool, &selected_view).is_some(), "Alt during a drawing stroke keeps the tip");
alt_stroke.kind = PointerKind::Up;
tool.pointer(&selected_view, &alt_stroke);
assert_eq!(tool.cursor(&selected_view, alt_stroke.pos, alt_stroke.mods), Cursor::Smooth);
assert!(bounds(&tool, &selected_view).is_none(), "Alt release borrows Smooth without a stale tip");
let precise = ToolContext { precise_cursors: true, ..cx(&d, &s, &p) };
assert!(bounds(&tool, &precise).is_none());
tool.pointer(&view, &at(Some(0.0)).with_mods(Mods { cmd: true, ..Default::default() }));