From d0410bddcd7ea43c51b6bf2442a99e58710e70eb Mon Sep 17 00:00:00 2001 From: Fox Caminiti Date: Mon, 27 Feb 2023 19:42:48 -0500 Subject: four duplicate layer types! --- src/main.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'src/main.cpp') 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; } -- cgit v1.2.3