Browse Source

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
ocornut 4 months ago
parent
commit
c43b138a69
2 changed files with 5 additions and 2 deletions
  1. 5 1
      imgui.cpp
  2. 0 1
      imgui_internal.h

+ 5 - 1
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

+ 0 - 1
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;
-    ImVector<ImTextureData*>Textures;
     double                  Time;
     int                     FrameCount;
     int                     FrameCountEnded;