diff options
author | Fox Caminiti <fox@foxcam.net> | 2023-02-27 19:42:48 -0500 |
---|---|---|
committer | Fox Caminiti <fox@foxcam.net> | 2023-02-27 19:42:48 -0500 |
commit | d0410bddcd7ea43c51b6bf2442a99e58710e70eb (patch) | |
tree | a18aa18266537126d05409b7bd1d37c5cbe268fb /src/main.cpp | |
parent | f20410406d863eea35894d00cd3ca5228d403743 (diff) |
four duplicate layer types!
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/main.cpp b/src/main.cpp index 894238a..42c07a9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1505,7 +1505,15 @@ int main(int argc, char *argv[]) { } break; case hotkey_duplicatelayer: { - State_ExecuteAtEnd = 2; + State->Interact_Active = interact_type_viewport_duplicate; + sorted_file Sorted = File_Sort_Push(File, State, &Memory); + History_Entry_Commit(&Memory, "Duplicate layers"); + v2 Offset = V2(State->Interact_Dup_Previous[0], State->Interact_Dup_Previous[1]); + Project_Layer_Duplicate(File, State, &Memory, Sorted.CompArray, Sorted.LayerArray, Offset, io.KeyCtrl); + State->Interact_Transform = {}; + History_Entry_End(&Memory); + File_Sort_Pop(&Memory, Sorted.Layer_SortSize, Sorted.Property_SortSize, Sorted.Source_SortSize); + State->Interact_Active = interact_type_none; } break; case hotkey_deletelayer: { @@ -1634,13 +1642,7 @@ int main(int argc, char *argv[]) { if (State_ExecuteAtEnd) { if (State_ExecuteAtEnd == 1) { Project_ShapeLayer_New(File, State, &Memory); - } else if (State_ExecuteAtEnd == 2) { - History_Entry_Commit(&Memory, "Duplicate layers"); - v2 Offset = V2(State->Interact_Dup_Previous[0], State->Interact_Dup_Previous[1]); - Project_Layer_Duplicate(File, State, &Memory, Sorted.CompArray, Sorted.LayerArray, Offset, 0, io.KeyCtrl); - State->Interact_Transform = {}; - History_Entry_End(&Memory); - } + } State->UpdateFrame = true; } |