mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-21 10:08:13 +08:00
Add point insertion to the Path tool (#754)
* Messaging cleanup * Add bezier iter * Add splitting * Use bezier_rs bounding box * Cleanup * Fix comments * Fix typo * Code review tweaks Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
co-authored by
Keavon Chambers
parent
d8b4055bcb
commit
3775aedab1
@@ -815,6 +815,24 @@ impl Document {
|
||||
}
|
||||
Some([update_thumbnails_upstream(&layer_path), vec![DocumentChanged, LayerChanged { path: layer_path }]].concat())
|
||||
}
|
||||
Operation::SetManipulatorPoints {
|
||||
layer_path,
|
||||
id,
|
||||
manipulator_type,
|
||||
position,
|
||||
} => {
|
||||
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) {
|
||||
if let Some(position) = position {
|
||||
manipulator_group.set_point_position(manipulator_type as usize, position.into());
|
||||
} else {
|
||||
manipulator_group.points[manipulator_type] = None;
|
||||
}
|
||||
self.mark_as_dirty(&layer_path)?;
|
||||
}
|
||||
}
|
||||
Some([update_thumbnails_upstream(&layer_path), vec![DocumentChanged, LayerChanged { path: layer_path }]].concat())
|
||||
}
|
||||
Operation::RemoveManipulatorPoint {
|
||||
layer_path,
|
||||
id,
|
||||
|
||||
Reference in New Issue
Block a user