Gradient tool improvements (#927)

* Reuse existing gradient

* Double click to insert gradient stop

* Add history states to the gradient tool

* Do trig in viewport space so it is actually perpendicular

* Sync tool options with active gradient

* Deleting points with delete key

* More tolerance on inserting points
This commit is contained in:
0HyperCube
2022-12-29 20:00:58 +00:00
committed by Keavon Chambers
parent 69293964c4
commit 0d703e857b
9 changed files with 281 additions and 24 deletions
@@ -116,6 +116,9 @@ pub fn default_mapping() -> Mapping {
entry!(KeyDown(Lmb); action_dispatch=GradientToolMessage::PointerDown),
entry!(PointerMove; refresh_keys=[Shift], action_dispatch=GradientToolMessage::PointerMove { constrain_axis: Shift }),
entry!(KeyUp(Lmb); action_dispatch=GradientToolMessage::PointerUp),
entry!(DoubleClick; action_dispatch=GradientToolMessage::InsertStop),
entry!(KeyDown(Delete); action_dispatch=GradientToolMessage::DeleteStop),
entry!(KeyDown(Backspace); action_dispatch=GradientToolMessage::DeleteStop),
//
// RectangleToolMessage
entry!(KeyDown(Lmb); action_dispatch=RectangleToolMessage::DragStart),