From c43b138a6988ada530d03b821cfdbc8a578149d2 Mon Sep 17 00:00:00 2001 From: ocornut Date: Thu, 17 Apr 2025 15:00:35 +0200 Subject: [PATCH] Fonts: no need to load current baked on SkipItems window? + removed unused field. Avoid baked staying active after GC. Might cause issues. # Conflicts: # imgui.cpp --- imgui.cpp | 6 +++++- imgui_internal.h | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index 881d40727..e2765edac 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -8625,9 +8625,13 @@ void ImGui::SetCurrentFont(ImFont* font, float font_size) void ImGui::UpdateCurrentFontSize() { ImGuiContext& g = *GImGui; + ImGuiWindow* window = g.CurrentWindow; + if (window != NULL && window->SkipItems) + return; + float final_size = g.FontSizeBeforeScaling * g.IO.FontGlobalScale; final_size *= g.Font->Scale; - if (ImGuiWindow* window = g.CurrentWindow) + if (window != NULL) final_size *= window->FontWindowScale; // Round font size diff --git a/imgui_internal.h b/imgui_internal.h index cb8ba5169..c4e064052 100644 --- a/imgui_internal.h +++ b/imgui_internal.h @@ -2144,7 +2144,6 @@ struct ImGuiContext float FontScale; // == FontBaked->Size / Font->FontSize. Scale factor over baked size. float CurrentDpiScale; // Current window/viewport DpiScale == CurrentViewport->DpiScale ImDrawListSharedData DrawListSharedData; - ImVectorTextures; double Time; int FrameCount; int FrameCountEnded;