Fonts: add optional out parameter to AddCustomRect()

This commit is contained in:
ocornut
2025-06-11 15:56:24 +02:00
parent 074bf39e40
commit 1ea9ff3677
2 changed files with 10 additions and 4 deletions
+1 -1
View File
@@ -3633,7 +3633,7 @@ struct ImFontAtlas
// - AddCustomRectRegular() --> Renamed to AddCustomRect()
// - 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 ImFontAtlasRectId AddCustomRect(int width, int height, ImFontAtlasRect* out_r = NULL);// 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)!