mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-22 13:18:11 +08:00
Add path closing and segment extension to the Pen tool (#753)
* Close paths with pen tool * Issue Z command always at end of path * Small code review style changes * Extending paths * Fix mirror on extend path * Code review tweaks Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
co-authored by
Keavon Chambers
parent
a40b6a0aa1
commit
d8b4055bcb
@@ -787,6 +787,13 @@ impl Document {
|
||||
}
|
||||
Some([update_thumbnails_upstream(&layer_path), vec![DocumentChanged, LayerChanged { path: layer_path }]].concat())
|
||||
}
|
||||
Operation::PushFrontManipulatorGroup { layer_path, manipulator_group } => {
|
||||
if let Ok(Some(shape)) = self.layer_mut(&layer_path).map(|layer| layer.as_subpath_mut()) {
|
||||
shape.manipulator_groups_mut().push_front(manipulator_group);
|
||||
self.mark_as_dirty(&layer_path)?;
|
||||
}
|
||||
Some([update_thumbnails_upstream(&layer_path), vec![DocumentChanged, LayerChanged { path: layer_path }]].concat())
|
||||
}
|
||||
Operation::RemoveManipulatorGroup { layer_path, id } => {
|
||||
if let Ok(Some(shape)) = self.layer_mut(&layer_path).map(|layer| layer.as_subpath_mut()) {
|
||||
shape.manipulator_groups_mut().remove(id);
|
||||
@@ -959,6 +966,21 @@ impl Document {
|
||||
self.mark_as_dirty(&layer_path)?;
|
||||
Some([vec![DocumentChanged, LayerChanged { path: layer_path.clone() }], update_thumbnails_upstream(&layer_path)].concat())
|
||||
}
|
||||
Operation::SetManipulatorHandleMirroring {
|
||||
layer_path,
|
||||
id,
|
||||
mirror_distance,
|
||||
mirror_angle,
|
||||
} => {
|
||||
if let Ok(Some(shape)) = self.layer_mut(&layer_path).map(|layer| layer.as_subpath_mut()) {
|
||||
if let Some(manipulator_group) = shape.manipulator_groups_mut().by_id_mut(id) {
|
||||
manipulator_group.editor_state.mirror_distance_between_handles = mirror_distance;
|
||||
manipulator_group.editor_state.mirror_angle_between_handles = mirror_angle;
|
||||
self.mark_as_dirty(&layer_path)?;
|
||||
}
|
||||
}
|
||||
Some([update_thumbnails_upstream(&layer_path), vec![DocumentChanged, LayerChanged { path: layer_path }]].concat())
|
||||
}
|
||||
Operation::SetSelectedHandleMirroring {
|
||||
layer_path,
|
||||
toggle_distance,
|
||||
|
||||
Reference in New Issue
Block a user