Selecting an individual anchor point deselects each of the other points (#963)

* Selecting an individual anchor point deselects each of the other points

* git gra

* Selecting intersecting shapes,selects top shape

* Merge commit

* cargo fmt

* fixed: can't drag multiple selected shapes.

* Merge commit

* Merge commit

* Code review tweaks

* Merge commit

* Fixed topmost layer and previous_mouse_position

* Fixed issues when clicking on anchors

* Works

* Function name change

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
Co-authored-by: Dennis Kobert <dennis@kobert.dev>
This commit is contained in:
Christopher Mendoza
2023-02-19 23:26:02 -08:00
committed by Keavon Chambers
co-authored by Keavon Chambers Dennis Kobert
parent 964cf6df15
commit b7f2163998
5 changed files with 57 additions and 13 deletions
@@ -103,6 +103,7 @@ impl ShapeEditor {
manipulator_group_id,
manipulator_type: ManipulatorType::from_index(manipulator_point_index),
};
points.push(point_info);
responses.push_back(
Operation::SelectManipulatorPoints {
@@ -187,6 +188,11 @@ impl ShapeEditor {
self.iter(document).flat_map(|shape| shape.manipulator_groups().iter())
}
// Sets the selected points to all points for the corresponding intersection
pub fn select_all_anchors(&self, responses: &mut VecDeque<Message>, itersections: Vec<u64>) {
responses.push_back(Operation::SelectAllAnchors { layer_path: itersections }.into());
}
/// Provide the currently selected points by reference.
pub fn selected_points<'a>(&'a self, document: &'a Document) -> impl Iterator<Item = &'a ManipulatorPoint> {
self.selected_manipulator_groups(document).flat_map(|manipulator_group| manipulator_group.selected_points())