summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp18
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;
}