diff --git a/src/hello_imgui/internal/borderless_resizable.cpp b/src/hello_imgui/internal/borderless_resizable.cpp index 69a441ee..a61121eb 100644 --- a/src/hello_imgui/internal/borderless_resizable.cpp +++ b/src/hello_imgui/internal/borderless_resizable.cpp @@ -26,9 +26,10 @@ void BorderlessResizableHandler( DragArea& dragAreaData, // modifiable reference DragCornerType cornerType, HelloImGui::BackendApi::WindowPointer window, - HelloImGui::BackendApi::IBackendWindowHelper * backendWindowHelper, - ImU32 highlightColor) + HelloImGui::BackendApi::IBackendWindowHelper * backendWindowHelper) { + auto highlightColor = ImGui::GetColorU32(ImGuiCol_FrameBgHovered, 0.8f); + ImVec2 mousePos = ImGui::GetIO().MousePos; // prevent multiple dragging event concurrent static bool Dragging = false; @@ -119,7 +120,6 @@ namespace HelloImGui { ImVec2 winPos = ImGui::GetMainViewport()->Pos; ImVec2 winSize = ImGui::GetMainViewport()->Size; - auto highlightColor = ImGui::GetColorU32(ImGuiCol_FrameBgHovered, 0.8f); ImVec2 dragPadding = HelloImGui::EmToVec2(1.5f, 1.5f); // check if main viewport focused @@ -184,7 +184,7 @@ namespace HelloImGui { auto& dragArea = key_value.second; auto cornerType = key_value.first; - BorderlessResizableHandler(dragArea, cornerType, window, backendWindowHelper, highlightColor); + BorderlessResizableHandler(dragArea, cornerType, window, backendWindowHelper); } } }