Implement the Spline Tool (#512)

* Add Spline Tool

* Adapt to changes from master

* Apply review feedback

* Fixes

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
Paul Kupper
2022-02-09 16:22:57 -08:00
committed by Keavon Chambers
co-authored by Keavon Chambers
parent c54774c4c3
commit 38e75c2232
17 changed files with 409 additions and 29 deletions
+2 -2
View File
@@ -1,4 +1,5 @@
use super::shared::resize::Resize;
use crate::consts::DRAG_THRESHOLD;
use crate::document::DocumentMessageHandler;
use crate::frontend::utility_types::MouseCursorIcon;
use crate::input::keyboard::{Key, MouseMotion};
@@ -134,8 +135,7 @@ impl Fsm for EllipseToolFsmState {
state
}
(Drawing, DragStop) => {
// TODO: introduce comparison threshold when operating with canvas coordinates (https://github.com/GraphiteEditor/Graphite/issues/100)
match shape_data.drag_start == input.mouse.position {
match shape_data.drag_start.distance(input.mouse.position) <= DRAG_THRESHOLD {
true => responses.push_back(DocumentMessage::AbortTransaction.into()),
false => responses.push_back(DocumentMessage::CommitTransaction.into()),
}