Răsfoiți Sursa

Fonts: fixed merging a font and specifying a font target in DstFont that's not the last added font (regression in 1.92). (#8912)

ocornut 6 zile în urmă
părinte
comite
20160ff1d5
2 a modificat fișierele cu 3 adăugiri și 1 ștergeri
  1. 2 0
      docs/CHANGELOG.txt
  2. 1 1
      imgui_draw.cpp

+ 2 - 0
docs/CHANGELOG.txt

@@ -47,6 +47,8 @@ Other Changes:
   ImGuiStyleVar_ScrollbarPadding enum, instead of hardcoded computed default. (#8895)
 - Fonts: fixed an assertion failure when a rectangle entry has been reused
   1024 times (e.g. due to constant change of font types). (#8906) [@cfillion]
+- Fonts: fixed merging a font and specifying a font target in DstFont
+  that's not the last added font (regression in 1.92). (#8912)
 - Clipper, Tables: added ImGuiListClipperFlags_NoSetTableRowCounters as a way to
   disable the assumption that 1 clipper item == 1 table row, which breaks when
   e.g. using clipper with ItemsHeight=1 in order to clip in pixel units. (#8886)

+ 1 - 1
imgui_draw.cpp

@@ -3026,7 +3026,7 @@ ImFont* ImFontAtlas::AddFont(const ImFontConfig* font_cfg_in)
     else
     {
         IM_ASSERT(Fonts.Size > 0 && "Cannot use MergeMode for the first font"); // When using MergeMode make sure that a font has already been added before. You can use ImGui::GetIO().Fonts->AddFontDefault() to add the default imgui font.
-        font = Fonts.back();
+        font = font_cfg_in->DstFont ? font_cfg_in->DstFont : Fonts.back();
     }
 
     // Add to list