mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-09 23:54:20 +00:00
Fonts: fixed NewFrame() when atlas builder has been created but fonts not added. Fixed GetCustomRect() after atlas clear.
This commit is contained in:
parent
29fbf3c1ec
commit
e1481a731d
2 changed files with 3 additions and 1 deletions
|
|
@ -4362,6 +4362,8 @@ ImTextureRect* ImFontAtlasPackGetRectSafe(ImFontAtlas* atlas, ImFontAtlasRectId
|
|||
if (id == ImFontAtlasRectId_Invalid)
|
||||
return NULL;
|
||||
int index_idx = ImFontAtlasRectId_GetIndex(id);
|
||||
if (atlas->Builder == NULL)
|
||||
ImFontAtlasBuildInit(atlas);
|
||||
ImFontAtlasBuilder* builder = (ImFontAtlasBuilder*)atlas->Builder;
|
||||
if (index_idx >= builder->RectsIndex.Size)
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue