diff --git a/Plugins/Cog/Source/CogImgui/Private/CogImguiContext.cpp b/Plugins/Cog/Source/CogImgui/Private/CogImguiContext.cpp index 5acbee3..c00e9ba 100644 --- a/Plugins/Cog/Source/CogImgui/Private/CogImguiContext.cpp +++ b/Plugins/Cog/Source/CogImgui/Private/CogImguiContext.cpp @@ -251,12 +251,18 @@ void FCogImguiContext::BeginFrame(float InDeltaTime) //------------------------------------------------------------------------------------------------------- if (bRefreshDPIScale) { - RefreshDPIScale(); + bRefreshDPIScale = false; + + BuildFont(); + + ImGuiStyle NewStyle = ImGuiStyle(); + ImGui::GetStyle() = MoveTemp(NewStyle); + NewStyle.ScaleAllSizes(DpiScale); } ImGui::NewFrame(); - DrawDebug(); + //DrawDebug(); } //-------------------------------------------------------------------------------------------------------------------------- @@ -624,18 +630,6 @@ void FCogImguiContext::SetDPIScale(float Value) bRefreshDPIScale = true; } -//-------------------------------------------------------------------------------------------------------------------------- -void FCogImguiContext::RefreshDPIScale() -{ - bRefreshDPIScale = false; - - BuildFont(); - - ImGuiStyle NewStyle = ImGuiStyle(); - ImGui::GetStyle() = MoveTemp(NewStyle); - NewStyle.ScaleAllSizes(DpiScale); -} - //-------------------------------------------------------------------------------------------------------------------------- void FCogImguiContext::BuildFont() { diff --git a/Plugins/Cog/Source/CogImgui/Public/CogImguiContext.h b/Plugins/Cog/Source/CogImgui/Public/CogImguiContext.h index 62c6176..c188ead 100644 --- a/Plugins/Cog/Source/CogImgui/Public/CogImguiContext.h +++ b/Plugins/Cog/Source/CogImgui/Public/CogImguiContext.h @@ -57,8 +57,6 @@ private: void TryReleaseGameMouseCapture(); - void RefreshDPIScale(); - void BuildFont(); ULocalPlayer* GetLocalPlayer() const;