Fonts: added RemoveCustomRect().

+ internally add ImFontAtlasPackReuseRectEntry()
This commit is contained in:
ocornut
2025-06-11 15:56:24 +02:00
parent e9cf3de58f
commit 23dc46c4f8
3 changed files with 22 additions and 12 deletions
+1
View File
@@ -3634,6 +3634,7 @@ struct ImFontAtlas
// - AddCustomRectFontGlyph() --> Prefer using custom ImFontLoader inside ImFontConfig
// - ImFontAtlasCustomRect --> Renamed to ImFontAtlasRect
IMGUI_API ImFontAtlasRectId AddCustomRect(int width, int height); // Register a rectangle. Return -1 (ImFontAtlasRectId_Invalid) on error.
IMGUI_API void RemoveCustomRect(ImFontAtlasRectId id); // Unregister a rectangle. Existing pixels will stay in texture until resized / garbage collected.
IMGUI_API bool GetCustomRect(ImFontAtlasRectId id, ImFontAtlasRect* out_r) const; // Get rectangle coordinates for current texture. Valid immediately, never store this (read above)!
//-------------------------------------------