mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-06 04:58:47 +02:00
ImFontAtlas: added ClearFonts(), making the different clear funcs more explicit (#224)
This commit is contained in:
14
imgui.cpp
14
imgui.cpp
@ -343,6 +343,7 @@
|
||||
- columns: columns header to act as button (~sort op) and allow resize/reorder (github issue #125)
|
||||
- columns: user specify columns size (github issue #125)
|
||||
- popup: border options. richer api like BeginChild() perhaps? (github issue #197)
|
||||
- combo: sparse combo boxes (via function call?)
|
||||
- combo: turn child handling code into pop up helper
|
||||
- combo: contents should extends to fit label if combo widget is small
|
||||
- combo/listbox: keyboard control. need inputtext like non-active focus + key handling. considering keybord for custom listbox (see github pr #203)
|
||||
@ -8384,10 +8385,8 @@ void ImFontAtlas::ClearTexData()
|
||||
TexPixelsRGBA32 = NULL;
|
||||
}
|
||||
|
||||
void ImFontAtlas::Clear()
|
||||
void ImFontAtlas::ClearFonts()
|
||||
{
|
||||
ClearInputData();
|
||||
ClearTexData();
|
||||
for (size_t i = 0; i < Fonts.size(); i++)
|
||||
{
|
||||
Fonts[i]->~ImFont();
|
||||
@ -8396,6 +8395,13 @@ void ImFontAtlas::Clear()
|
||||
Fonts.clear();
|
||||
}
|
||||
|
||||
void ImFontAtlas::Clear()
|
||||
{
|
||||
ClearInputData();
|
||||
ClearTexData();
|
||||
ClearFonts();
|
||||
}
|
||||
|
||||
void ImGui::GetDefaultFontData(const void** fnt_data, unsigned int* fnt_size, const void** png_data, unsigned int* png_size)
|
||||
{
|
||||
printf("GetDefaultFontData() is obsoleted in ImGui 1.30.\n");
|
||||
@ -9824,7 +9830,7 @@ void ImGui::ShowTestWindow(bool* opened)
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
||||
if (ImGui::TreeNode("Fonts"))
|
||||
if (ImGui::TreeNode("Fonts", "Fonts (%d)", (int)ImGui::GetIO().Fonts->Fonts.size()))
|
||||
{
|
||||
ImGui::TextWrapped("Tip: Load fonts with GetIO().Fonts->AddFontFromFileTTF().");
|
||||
for (size_t i = 0; i < ImGui::GetIO().Fonts->Fonts.size(); i++)
|
||||
|
Reference in New Issue
Block a user