mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-02 20:58:12 +08:00
Implement Freehand Tool (#503)
* Implement freehand tool * Address review comments * Consistent ordering of tools * Add hotkey N for freehand tool * Tweak freehand tool hint
This commit is contained in:
committed by
Keavon Chambers
parent
dae79caf15
commit
0da8dabba9
@@ -84,7 +84,6 @@ struct PenToolData {
|
||||
next_point: DVec2,
|
||||
weight: u32,
|
||||
path: Option<Vec<LayerId>>,
|
||||
layer_exists: bool,
|
||||
snap_handler: SnapHandler,
|
||||
}
|
||||
|
||||
@@ -111,7 +110,6 @@ impl Fsm for PenToolFsmState {
|
||||
responses.push_back(DocumentMessage::StartTransaction.into());
|
||||
responses.push_back(DocumentMessage::DeselectAllLayers.into());
|
||||
data.path = Some(vec![generate_uuid()]);
|
||||
data.layer_exists = false;
|
||||
|
||||
data.snap_handler.start_snap(document, document.visible_layers());
|
||||
let snapped_position = data.snap_handler.snap_position(responses, input.viewport_bounds.size(), document, input.mouse.position);
|
||||
@@ -220,7 +218,7 @@ fn make_operation(data: &PenToolData, tool_data: &DocumentToolData, show_preview
|
||||
points.push((data.next_point.x, data.next_point.y))
|
||||
}
|
||||
|
||||
Operation::AddPen {
|
||||
Operation::AddPolyline {
|
||||
path: data.path.clone().unwrap(),
|
||||
insert_index: -1,
|
||||
transform: DAffine2::IDENTITY.to_cols_array(),
|
||||
|
||||
Reference in New Issue
Block a user