Pen: Escape after the path is deselected ends something else

The Pen and the Smart Pen reported a path being drawn to Escape for as
long as they remembered the path, even after Deselect or Undo left it
unselected. That Escape then ended nothing, and isolation mode or a
rotated view needed a second press. Both tools now report the path only
while they would go on drawing it, as the Curvature tool does.

Follows #6405
This commit is contained in:
dotCooCoo
2026-11-11 03:44:25 -08:00
parent 4e0e1c8af7
commit 4cde1aaa1f
3 changed files with 21 additions and 4 deletions
+2 -2
View File
@@ -548,8 +548,8 @@ impl Tool for SmartPenTool {
}
/// A path being drawn: Escape ends it.
fn ends_on_escape(&self, _cx: &ToolContext) -> bool {
self.path.is_some()
fn ends_on_escape(&self, cx: &ToolContext) -> bool {
self.active(cx).is_some()
}
fn deactivate(&mut self, _cx: &ToolContext) -> Vec<Action> {
+2 -2
View File
@@ -243,8 +243,8 @@ impl Tool for PenTool {
self.drag.is_some() || self.handle.is_some() || self.convert.is_some()
}
/// A path being drawn: Escape ends it.
fn ends_on_escape(&self, _cx: &ToolContext) -> bool {
self.path.is_some()
fn ends_on_escape(&self, cx: &ToolContext) -> bool {
self.active(cx).is_some()
}
fn pointer(&mut self, cx: &ToolContext, ev: &PointerEvent) -> Vec<Action> {
let tol = cx.tol(5.0).max(cx.point_tol());