mirror of
https://github.com/ocornut/imgui.git
synced 2026-02-01 03:30:06 +00:00
parent
a5739a0aa3
commit
9cda86d55a
3 changed files with 17 additions and 31 deletions
|
|
@ -1461,15 +1461,9 @@ ImFont* ImFontAtlas::AddFont(const ImFontConfig* font_cfg)
|
|||
|
||||
// Create new font
|
||||
if (!font_cfg->MergeMode)
|
||||
{
|
||||
ImFont* font = (ImFont*)ImGui::MemAlloc(sizeof(ImFont));
|
||||
IM_PLACEMENT_NEW(font) ImFont();
|
||||
Fonts.push_back(font);
|
||||
}
|
||||
Fonts.push_back(IM_NEW(ImFont));
|
||||
else
|
||||
{
|
||||
IM_ASSERT(!Fonts.empty()); // 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.
|
||||
}
|
||||
|
||||
ConfigData.push_back(*font_cfg);
|
||||
ImFontConfig& new_font_cfg = ConfigData.back();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue