2
0
Эх сурвалжийг харах

Fixed io.ConfigDpiScaleFonts from ever working since 1.92. (#8832, #8465)

Merge fix e4055e763 didn't update the code properly.
ocornut 13 цаг өмнө
parent
commit
e8ca7af4c0
2 өөрчлөгдсөн 7 нэмэгдсэн , 0 устгасан
  1. 5 0
      docs/CHANGELOG.txt
  2. 2 0
      imgui.cpp

+ 5 - 0
docs/CHANGELOG.txt

@@ -102,6 +102,11 @@ Other Changes:
 
 Docking+Viewports Branch:
 
+- DPI: fixed io.ConfigDpiScaleFonts from ever working since 1.92 (the irony
+  being that it is when it started to make sense!). As a reminder, the option
+  automatically copy the _current_ viewport DpiScale to style.FontScaleDpi.
+  This is why we separated the style.FontScaleMain and style.FontScaleDpi scaling
+  factor, as the later is meant to be overwritten. (#8832, #8465)
 - DPI: Fixed obsoleted ImGuiConfigFlags_DpiEnableScaleFonts/_DpiEnableScaleViewports
   names from setting the equivalent io.ConfigDpiScaleFonts/io.ConfigDpiScaleViewports
   flag correctly (regression in 1.92).

+ 2 - 0
imgui.cpp

@@ -16254,6 +16254,8 @@ void ImGui::SetCurrentViewport(ImGuiWindow* current_window, ImGuiViewportP* view
     g.CurrentViewport = viewport;
     IM_ASSERT(g.CurrentDpiScale > 0.0f && g.CurrentDpiScale < 99.0f); // Typical correct values would be between 1.0f and 4.0f
     //IMGUI_DEBUG_LOG_VIEWPORT("[viewport] SetCurrentViewport changed '%s' 0x%08X\n", current_window ? current_window->Name : NULL, viewport ? viewport->ID : 0);
+    if (g.IO.ConfigDpiScaleFonts)
+        g.Style.FontScaleDpi = g.CurrentDpiScale;
 
     // Notify platform layer of viewport changes
     // FIXME-DPI: This is only currently used for experimenting with handling of multiple DPI