mirror of
https://github.com/Drezil/imgui.git
synced 2024-12-18 06:06:35 +00:00
Fixed ClearInputData()
This commit is contained in:
parent
6c3ab6fc9b
commit
80276ef07b
@ -9706,6 +9706,12 @@ void ImFontAtlas::ClearInputData()
|
||||
ImGui::MemFree(ConfigData[i].FontData);
|
||||
ConfigData[i].FontData = NULL;
|
||||
}
|
||||
for (int i = 0; i < Fonts.Size; i++)
|
||||
if (Fonts[i]->ConfigData >= ConfigData.Data && Fonts[i]->ConfigData < ConfigData.Data + ConfigData.Size)
|
||||
{
|
||||
Fonts[i]->ConfigData = NULL;
|
||||
Fonts[i]->ConfigDataCount = 0;
|
||||
}
|
||||
ConfigData.clear();
|
||||
}
|
||||
|
||||
@ -11260,7 +11266,7 @@ void ImGui::ShowTestWindow(bool* opened)
|
||||
for (int i = 0; i < atlas->Fonts.Size; i++)
|
||||
{
|
||||
ImFont* font = atlas->Fonts[i];
|
||||
ImGui::BulletText("Font %d: \'%s\', %.2f px, %d glyphs", i, font->ConfigData[0].Name, font->FontSize, font->Glyphs.Size);
|
||||
ImGui::BulletText("Font %d: \'%s\', %.2f px, %d glyphs", i, font->ConfigData ? font->ConfigData[0].Name : "", font->FontSize, font->Glyphs.Size);
|
||||
ImGui::TreePush((void*)i);
|
||||
if (i > 0) { ImGui::SameLine(); if (ImGui::SmallButton("Set as default")) { atlas->Fonts[i] = atlas->Fonts[0]; atlas->Fonts[0] = font; } }
|
||||
ImGui::PushFont(font);
|
||||
|
Loading…
Reference in New Issue
Block a user