diff options
Diffstat (limited to 'src/imgui_ui.cpp')
-rw-r--r-- | src/imgui_ui.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/imgui_ui.cpp b/src/imgui_ui.cpp index 7c8adf9..871c69d 100644 --- a/src/imgui_ui.cpp +++ b/src/imgui_ui.cpp @@ -192,6 +192,14 @@ ImGui_Key_GetUIInfo(key_entry KeyEntry, real32 KeySize, ImVec2 *Offset_ScreenPos *KeyScreenSize = (KeyEntry.WidthRatio > 0.0f) ? ImVec2(KeySize * KeyEntry.WidthRatio, KeySize) : ImVec2(KeySize, KeySize * -KeyEntry.WidthRatio); } +inline void +ImGui_DrawCenteredRect(ImDrawList *draw_list, ImVec2 Point, real32 Width, uint32 col) +{ + ImVec2 MinPos = Point - ImVec2(Width/2, Width/2); + ImVec2 MaxPos = Point + ImVec2(Width/2, Width/2); + draw_list->AddRectFilled(MinPos, MaxPos, col); +} + static void ImGui_KeybindUI(project_data *File, project_state *State, ui *UI, memory *Memory, ImGuiIO io) { @@ -433,6 +441,7 @@ ImGui_ProcessInputs(project_data *File, project_state *State, ui *UI, memory *Me 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); + State->Interact_Transform = {}; History_Entry_End(Memory); } else { State->Tool = tool_pen; |