Make duplicating folders also duplicate its children (#1178)

* Latest changes

* Add layer attempt

* layer tree is now correct after duplicating layers

* Latest changes

* Latest Changes

* Recursive idea

* Moving Layers to Dup Folder - not done

* latest changes

* latest progress

* Latest Changes

* Latest Changes

* Latest Changes

* Latest

* Latest

* Latest

* Duplicating Folders works

* Initial Refactoring

* Ready for QA

* Doesn't select all the children after duplicate anymore

* First pass code review with major cleanup

* Removed unused next_asssignment_id function and updated FolderLayer struct

* Removed unused logic

* First iteration of cleaning up the code

* Added Ollie's suggestions

* Code review cleanup

---------

Co-authored-by: Ollie Dolan <olliedolan10@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
Christopher Mendoza
2023-05-19 00:41:16 -07:00
committed by Keavon Chambers
co-authored by Ollie Dolan Keavon Chambers
parent 6400953af5
commit bb1e7c44cf
7 changed files with 250 additions and 33 deletions
@@ -368,6 +368,7 @@ impl SelectToolData {
layer: Box::new(layer),
destination_path: layer_path.clone(),
insert_index: -1,
duplicating: false,
});
responses.add(DocumentMessage::UpdateLayerMetadata {
layer_path: layer_path.clone(),
@@ -1219,8 +1220,6 @@ fn edit_layer_deepest_manipulation(intersect: &Layer, responses: &mut VecDeque<M
}
fn recursive_search(document: &DocumentMessageHandler, layer_path: &Vec<u64>, incoming_layer_path_vector: &Vec<u64>) -> bool {
// TODO: fix below, then QA
// DOUBLE CLICK BROKEN
let layer_paths = document.document_legacy.folder_children_paths(layer_path);
for path in layer_paths {
if path == *incoming_layer_path_vector {