Fonts: added ImFontAtlas::RemoveFont(), fixed various leaks.

This commit is contained in:
ocornut
2024-12-19 16:21:07 +01:00
parent df8450d928
commit cec3e945f0
4 changed files with 84 additions and 6 deletions

View File

@@ -16484,6 +16484,12 @@ void ImGui::DebugNodeFont(ImFont* font)
}
if (SmallButton("Set as default"))
GetIO().FontDefault = font;
if (font->ContainerAtlas->Fonts.Size > 1 && !font->ContainerAtlas->Locked)
{
SameLine();
if (SmallButton("Remove"))
font->ContainerAtlas->RemoveFont(font);
}
// Display details
SetNextItemWidth(GetFontSize() * 8);