mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-20 03:18:06 +08:00
Generify functions in document.rs (#488)
* Generify functions in document.rs
This commit is contained in:
committed by
Keavon Chambers
parent
443f3d3b00
commit
72e638c5da
@@ -242,7 +242,7 @@ impl<'a> Selected<'a> {
|
||||
let transformation = pivot * delta * pivot.inverse();
|
||||
|
||||
// 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())) {
|
||||
for layer_path in Document::shallowest_unique_layers(self.selected.iter()) {
|
||||
let parent_folder_path = &layer_path[..layer_path.len() - 1];
|
||||
let original_layer_transforms = *self.original_transforms.get(layer_path).unwrap();
|
||||
|
||||
|
||||
@@ -236,10 +236,10 @@ impl Fsm for SelectToolFsmState {
|
||||
|
||||
let closest_move = data.snap_handler.snap_layers(document, &data.layers_dragging, mouse_delta);
|
||||
// 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 path in Document::shallowest_unique_layers(data.layers_dragging.iter().map(|path| path.as_slice())) {
|
||||
for path in Document::shallowest_unique_layers(data.layers_dragging.iter()) {
|
||||
responses.push_front(
|
||||
Operation::TransformLayerInViewport {
|
||||
path: path.to_vec(),
|
||||
path: path.clone(),
|
||||
transform: DAffine2::from_translation(mouse_delta + closest_move).to_cols_array(),
|
||||
}
|
||||
.into(),
|
||||
|
||||
Reference in New Issue
Block a user