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:
parent
752df128e3
commit
c9d3453e46
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue