mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-13 17:32:42 -06:00
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:
@@ -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> {
|
||||
|
||||
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user