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:
0HyperCube
2022-08-21 14:43:24 -07:00
committed by GitHub
co-authored by Keavon Chambers
parent d8b4055bcb
commit 3775aedab1
11 changed files with 239 additions and 39 deletions
+18
View File
@@ -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,