Fonts: moved ImFontAtlasRectId back to public API.

This commit is contained in:
ocornut
2025-03-31 18:37:11 +02:00
parent 69d28f867c
commit e9cf3de58f
3 changed files with 15 additions and 14 deletions

View File

@@ -3222,7 +3222,7 @@ void ImFontAtlas::RemoveFont(ImFont* font)
ImFontAtlasBuildNotifySetFont(this, font, new_current_font);
}
int ImFontAtlas::AddCustomRect(int width, int height)
ImFontAtlasRectId ImFontAtlas::AddCustomRect(int width, int height)
{
IM_ASSERT(width > 0 && width <= 0xFFFF);
IM_ASSERT(height > 0 && height <= 0xFFFF);
@@ -3289,9 +3289,9 @@ int ImFontAtlas::AddCustomRectFontGlyphForSize(ImFont* font, float font_size, Im
}
#endif // #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
bool ImFontAtlas::GetCustomRect(int id, ImFontAtlasRect* out_r) const
bool ImFontAtlas::GetCustomRect(ImFontAtlasRectId id, ImFontAtlasRect* out_r) const
{
ImTextureRect* r = ImFontAtlasPackGetRect((ImFontAtlas*)this, (ImFontAtlasRectId)id);
ImTextureRect* r = ImFontAtlasPackGetRect((ImFontAtlas*)this, id);
if (r == NULL)
return false;
IM_ASSERT(TexData->Width > 0 && TexData->Height > 0); // Font atlas needs to be built before we can calculate UV coordinates