From ed548485369f3d36658714a30b95ae9f66dd9b31 Mon Sep 17 00:00:00 2001 From: Fabio Arnold Date: Wed, 23 Aug 2023 12:24:22 +0200 Subject: [PATCH] Fix macOS DPI scaling --- profiler/src/main.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/profiler/src/main.cpp b/profiler/src/main.cpp index fc5678b9..c9d8a961 100644 --- a/profiler/src/main.cpp +++ b/profiler/src/main.cpp @@ -136,6 +136,13 @@ static void SetupDPIScale( float scale, ImFont*& cb_fixedWidth, ImFont*& cb_bigF { LoadFonts( scale, cb_fixedWidth, cb_bigFont, cb_smallFont ); +#ifdef __APPLE__ + // No need to upscale the style on macOS, but we need to downscale the fonts. + ImGuiIO& io = ImGui::GetIO(); + io.FontGlobalScale = 1.0f / dpiScale; + scale = 1.0f; +#endif + auto& style = ImGui::GetStyle(); style = ImGuiStyle(); ImGui::StyleColorsDark();