mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-17 23:38:06 +08:00
Do not transform layers when transforming a parent folder (#481)
* Modify all message enum data to use named struct values, not tuples (#479) * Massively reorganize and clean up the whole Rust codebase * Modify all message enum data to use named struct values, not tuples * Do not transform layers when transforming parent * Reduce complexity to O(nlogn) * Add TODO comment about performance Co-authored-by: Keavon Chambers <keavon@keavon.com> Co-authored-by: Dennis <dennis@kobert.dev>
This commit is contained in:
committed by
Keavon Chambers
parent
bd3191f16e
commit
adcd7cd9a3
@@ -181,7 +181,7 @@ impl DocumentMessageHandler {
|
||||
}
|
||||
|
||||
pub fn selected_layers_without_children(&self) -> Vec<&[LayerId]> {
|
||||
let unique_layers = self.graphene_document.shallowest_unique_layers(self.selected_layers());
|
||||
let unique_layers = GrapheneDocument::shallowest_unique_layers(self.selected_layers());
|
||||
|
||||
// We need to maintain layer ordering
|
||||
self.sort_layers(unique_layers.iter().copied())
|
||||
|
||||
@@ -241,7 +241,8 @@ impl<'a> Selected<'a> {
|
||||
let pivot = DAffine2::from_translation(*self.pivot);
|
||||
let transformation = pivot * delta * pivot.inverse();
|
||||
|
||||
for layer_path in &self.selected {
|
||||
// TODO: Cache the result of `shallowest_unique_layers` to avoid this heavy computation every frame of movement, see https://github.com/GraphiteEditor/Graphite/pull/481
|
||||
for layer_path in Document::shallowest_unique_layers(self.selected.iter().map(|path| path.as_slice())) {
|
||||
let parent_folder_path = &layer_path[..layer_path.len() - 1];
|
||||
let original_layer_transforms = *self.original_transforms.get(layer_path).unwrap();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user