mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-23 02:38:12 +08:00
Add 'select all points' method to ShapeState struct (#1386)
* Added select all points method to ShapeState struct * Map select_all_points functions to shortcut * Make SelectAllPoints action relevant in the current context only * Refactor select_all_points to only select anchors * Fix(editor): enable selected point update after selection change via clicking
This commit is contained in:
@@ -106,6 +106,20 @@ impl ShapeState {
|
||||
None
|
||||
}
|
||||
|
||||
pub fn select_all_points(&mut self, document: &Document) {
|
||||
for (layer_path, selected_layer_state) in self.selected_shape_state.iter_mut() {
|
||||
let Ok(layer) = document.layer(layer_path) else { continue };
|
||||
let Some(vector_data) = layer.as_vector_data() else { continue };
|
||||
|
||||
for group in vector_data.manipulator_groups() {
|
||||
selected_layer_state.select_point(ManipulatorPointId::new(group.id, SelectedType::Anchor));
|
||||
for selected_type in &[SelectedType::InHandle, SelectedType::OutHandle] {
|
||||
selected_layer_state.deselect_point(ManipulatorPointId::new(group.id, *selected_type));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn deselect_all(&mut self) {
|
||||
self.selected_shape_state.values_mut().for_each(|state| state.selected_points.clear());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user