Fonts: Misc merge fixes.

This commit is contained in:
ocornut
2025-06-11 18:11:45 +02:00
parent 1e130e045b
commit e4055e763f
3 changed files with 2 additions and 5 deletions

View File

@@ -4491,7 +4491,7 @@ ImGuiWindow::ImGuiWindow(ImGuiContext* ctx, const char* name) : DrawListInst(NUL
LastFrameJustFocused = -1; LastFrameJustFocused = -1;
LastTimeActive = -1.0f; LastTimeActive = -1.0f;
FontRefSize = 0.0f; FontRefSize = 0.0f;
FontWindowScale = FontWindowScaleParents = FontDpiScale = 1.0f; FontWindowScale = FontWindowScaleParents = 1.0f;
SettingsOffset = -1; SettingsOffset = -1;
DockOrder = -1; DockOrder = -1;
DrawList = &DrawListInst; DrawList = &DrawListInst;
@@ -7833,7 +7833,6 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
WindowSelectViewport(window); WindowSelectViewport(window);
SetCurrentViewport(window, window->Viewport); SetCurrentViewport(window, window->Viewport);
window->FontDpiScale = g.IO.ConfigDpiScaleFonts ? window->Viewport->DpiScale : 1.0f;
SetCurrentWindow(window); SetCurrentWindow(window);
flags = window->Flags; flags = window->Flags;
@@ -7978,7 +7977,6 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
// FIXME-DPI // FIXME-DPI
//IM_ASSERT(old_viewport->DpiScale == window->Viewport->DpiScale); // FIXME-DPI: Something went wrong //IM_ASSERT(old_viewport->DpiScale == window->Viewport->DpiScale); // FIXME-DPI: Something went wrong
SetCurrentViewport(window, window->Viewport); SetCurrentViewport(window, window->Viewport);
window->FontDpiScale = g.IO.ConfigDpiScaleViewports ? window->Viewport->DpiScale : 1.0f;
SetCurrentWindow(window); SetCurrentWindow(window);
} }

View File

@@ -2454,7 +2454,7 @@ struct ImGuiIO
// DPI/Scaling options // DPI/Scaling options
// This may keep evolving during 1.92.x releases. Expect some turbulence. // This may keep evolving during 1.92.x releases. Expect some turbulence.
bool ConfigDpiScaleFonts; // = false // [EXPERIMENTAL] Request bitmap-scaled fonts to match DpiScale. This is a very low-quality workaround. The correct way to handle DPI is _currently_ to replace the atlas and/or fonts in the Platform_OnChangedViewport callback, but this is all early work in progress. bool ConfigDpiScaleFonts; // = false // [EXPERIMENTAL] Automatically overwrite style.FontScaleDpi when Monitor DPI changes. This will scale fonts but _NOT_ scale sizes/padding for now.
bool ConfigDpiScaleViewports; // = false // [EXPERIMENTAL] Scale Dear ImGui and Platform Windows when Monitor DPI changes. bool ConfigDpiScaleViewports; // = false // [EXPERIMENTAL] Scale Dear ImGui and Platform Windows when Monitor DPI changes.
// Miscellaneous options // Miscellaneous options

View File

@@ -2871,7 +2871,6 @@ struct IMGUI_API ImGuiWindow
ImVector<ImGuiOldColumns> ColumnsStorage; ImVector<ImGuiOldColumns> ColumnsStorage;
float FontWindowScale; // User scale multiplier per-window, via SetWindowFontScale() float FontWindowScale; // User scale multiplier per-window, via SetWindowFontScale()
float FontWindowScaleParents; float FontWindowScaleParents;
float FontDpiScale;
float FontRefSize; // This is a copy of window->CalcFontSize() at the time of Begin(), trying to phase out CalcFontSize() especially as it may be called on non-current window. float FontRefSize; // This is a copy of window->CalcFontSize() at the time of Begin(), trying to phase out CalcFontSize() especially as it may be called on non-current window.
int SettingsOffset; // Offset into SettingsWindows[] (offsets are always valid as we only grow the array from the back) int SettingsOffset; // Offset into SettingsWindows[] (offsets are always valid as we only grow the array from the back)