Skip to content

Commit

Permalink
Fix macOS DPI scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
fabioarnold committed Aug 23, 2023
1 parent 1491e5d commit ed54848
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions profiler/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit ed54848

Please sign in to comment.