From 670775ac22e4fb93be2335d9c4ceb50f5f9ab056 Mon Sep 17 00:00:00 2001 From: omar Date: Thu, 13 Apr 2017 20:01:24 +0200 Subject: [PATCH] Added assert/comment about using MergeMode (#1100) --- imgui_draw.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/imgui_draw.cpp b/imgui_draw.cpp index 1b2e9e0c..b0931b60 100644 --- a/imgui_draw.cpp +++ b/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();