浏览代码

Added assert/comment about using MergeMode (#1100)

omar 8 年之前
父节点
当前提交
670775ac22
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      imgui_draw.cpp

+ 4 - 0
imgui_draw.cpp

@@ -1143,6 +1143,10 @@ ImFont* ImFontAtlas::AddFont(const ImFontConfig* font_cfg)
         IM_PLACEMENT_NEW(font) ImFont();
         Fonts.push_back(font);
     }
+    else
+    {
+        IM_ASSERT(!Fonts.empty()); // When using MergeMode make sure that a font has already been added before. You can use ImGui::AddFontDefault() to add the default imgui font.
+    }
 
     ConfigData.push_back(*font_cfg);
     ImFontConfig& new_font_cfg = ConfigData.back();