Browse Source

Fonts: PushFontSize() with -1 uses sources[0]'s size for now (backward compat design)

ocornut 7 tháng trước cách đây
mục cha
commit
82b81fce68
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      imgui.cpp

+ 1 - 1
imgui.cpp

@@ -8636,7 +8636,7 @@ void ImGui::PushFont(ImFont* font, float font_size)
     if (font == NULL)
         font = GetDefaultFont();
     if (font_size < 0.0f)
-        font_size = g.FontSize;
+        font_size = font->Sources[0].SizePixels; // g.FontSize;
     g.FontStack.push_back({ font, font_size });
     SetCurrentFont(font, font_size);
 }