Fonts: fixed FontBaked=NULL in initial call to SetCurrentWindow() in Begin() using previous frame value of SkipItems. (#8465)

ref 0e769c5
This commit is contained in:
ocornut
2025-06-13 16:43:58 +02:00
parent 1ec1510ef7
commit ca3169310e

View File

@@ -4475,12 +4475,15 @@ static void SetCurrentWindow(ImGuiWindow* window)
g.CurrentDpiScale = 1.0f; // FIXME-DPI: WIP this is modified in docking g.CurrentDpiScale = 1.0f; // FIXME-DPI: WIP this is modified in docking
if (window) if (window)
{ {
bool backup_skip_items = window->SkipItems;
window->SkipItems = false;
if (g.IO.BackendFlags & ImGuiBackendFlags_RendererHasTextures) if (g.IO.BackendFlags & ImGuiBackendFlags_RendererHasTextures)
{ {
ImGuiViewport* viewport = window->Viewport; ImGuiViewport* viewport = window->Viewport;
g.FontRasterizerDensity = (viewport->FramebufferScale.x != 0.0f) ? viewport->FramebufferScale.x : g.IO.DisplayFramebufferScale.x; // == SetFontRasterizerDensity() g.FontRasterizerDensity = (viewport->FramebufferScale.x != 0.0f) ? viewport->FramebufferScale.x : g.IO.DisplayFramebufferScale.x; // == SetFontRasterizerDensity()
} }
ImGui::UpdateCurrentFontSize(0.0f); ImGui::UpdateCurrentFontSize(0.0f);
window->SkipItems = backup_skip_items;
ImGui::NavUpdateCurrentWindowIsScrollPushableX(); ImGui::NavUpdateCurrentWindowIsScrollPushableX();
} }
} }
@@ -8695,6 +8698,21 @@ bool ImGui::IsRectVisible(const ImVec2& rect_min, const ImVec2& rect_max)
// Most of the relevant font logic is in imgui_draw.cpp. // Most of the relevant font logic is in imgui_draw.cpp.
// Those are high-level support functions. // Those are high-level support functions.
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// - UpdateFontsNewFrame() [Internal]
// - UpdateFontsEndFrame() [Internal]
// - GetDefaultFont() [Internal]
// - RegisterUserTexture() [Internal]
// - UnregisterUserTexture() [Internal]
// - RegisterFontAtlas() [Internal]
// - UnregisterFontAtlas() [Internal]
// - SetCurrentFont() [Internal]
// - UpdateCurrentFontSize() [Internal]
// - SetFontRasterizerDensity() [Internal]
// - PushFont()
// - PopFont()
// - PushFontSize()
// - PopFontSize()
//-----------------------------------------------------------------------------
void ImGui::UpdateFontsNewFrame() void ImGui::UpdateFontsNewFrame()
{ {