Improve layer positioning in graph upon reordering; improve history system; add selection history (#1945)

* Improve layer positioning

* Collapse space when deleting

* Improve moving layers in layer panel

* Improved transactions

* Selection history

* Code review

* Select previous selection when aborting

* Fix crash and artboard select

* Add mouse forward/back button selection history bindings

Code review

* Menu buttons

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
adamgerhant
2024-09-01 02:34:18 -07:00
committed by GitHub
co-authored by Keavon Chambers
parent 432385343e
commit 9adc640f19
29 changed files with 806 additions and 443 deletions
@@ -45,11 +45,8 @@ impl Pivot {
/// Recomputes the pivot position and transform.
fn recalculate_pivot(&mut self, document: &DocumentMessageHandler) {
let mut layers = document
.network_interface
.selected_nodes(&[])
.unwrap()
.selected_visible_and_unlocked_layers(&document.network_interface);
let selected_nodes = document.network_interface.selected_nodes(&[]).unwrap();
let mut layers = selected_nodes.selected_visible_and_unlocked_layers(&document.network_interface);
let Some(first) = layers.next() else {
// If no layers are selected then we revert things back to default
self.normalized_pivot = DVec2::splat(0.5);