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
parent 6400953af5
commit bb1e7c44cf
7 changed files with 250 additions and 33 deletions

View File

@@ -3,6 +3,8 @@ use super::style::RenderData;
use crate::intersection::Quad;
use crate::{DocumentError, LayerId};
use graphene_core::uuid::generate_uuid;
use glam::DVec2;
use serde::{Deserialize, Serialize};
@@ -147,6 +149,10 @@ impl FolderLayer {
Some(&mut self.layers[pos])
}
pub fn generate_new_folder_ids(&mut self) {
self.next_assignment_id = generate_uuid();
}
/// Returns `true` if the folder contains a layer with the given [LayerId].
///
/// # Example