mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 14:18:04 +08:00
Fix undo not immediately removing copy/pasted layer (#1381)
Bugfix: Undo does not work when copy/pasting layers (or groups), it should remove the layer that was pasted
This commit is contained in:
@@ -393,17 +393,17 @@ impl MessageHandler<PortfolioMessage, (&InputPreprocessorMessageHandler, &Prefer
|
||||
for entry in data.iter().rev() {
|
||||
let destination_path = [shallowest_common_folder.to_vec(), vec![generate_uuid()]].concat();
|
||||
|
||||
responses.add_front(DocumentMessage::UpdateLayerMetadata {
|
||||
layer_path: destination_path.clone(),
|
||||
layer_metadata: entry.layer_metadata,
|
||||
});
|
||||
document.load_layer_resources(responses, &entry.layer.data, destination_path.clone(), self.active_document_id.unwrap());
|
||||
responses.add_front(DocumentOperation::InsertLayer {
|
||||
responses.add(DocumentOperation::InsertLayer {
|
||||
layer: Box::new(entry.layer.clone()),
|
||||
destination_path,
|
||||
destination_path: destination_path.clone(),
|
||||
insert_index: -1,
|
||||
duplicating: false,
|
||||
});
|
||||
responses.add(DocumentMessage::UpdateLayerMetadata {
|
||||
layer_path: destination_path,
|
||||
layer_metadata: entry.layer_metadata,
|
||||
});
|
||||
}
|
||||
|
||||
responses.add(DocumentMessage::CommitTransaction);
|
||||
|
||||
Reference in New Issue
Block a user