mirror of
https://github.com/ocornut/imgui.git
synced 2025-09-05 19:08:19 +00:00
Fonts: fixed unused variable warning.
This commit is contained in:
@@ -4330,10 +4330,9 @@ ImTextureRect* ImFontAtlasPackGetRect(ImFontAtlas* atlas, ImFontAtlasRectId id)
|
||||
{
|
||||
IM_ASSERT(id != ImFontAtlasRectId_Invalid);
|
||||
int index_idx = ImFontAtlasRectId_GetIndex(id);
|
||||
int generation = ImFontAtlasRectId_GetGeneration(id);
|
||||
ImFontAtlasBuilder* builder = (ImFontAtlasBuilder*)atlas->Builder;
|
||||
ImFontAtlasRectEntry* index_entry = &builder->RectsIndex[index_idx];
|
||||
IM_ASSERT(index_entry->Generation == generation);
|
||||
IM_ASSERT(index_entry->Generation == ImFontAtlasRectId_GetGeneration(id));
|
||||
IM_ASSERT(index_entry->IsUsed);
|
||||
return &builder->Rects[index_entry->TargetIndex];
|
||||
}
|
||||
@@ -4345,12 +4344,11 @@ ImTextureRect* ImFontAtlasPackGetRectSafe(ImFontAtlas* atlas, ImFontAtlasRectId
|
||||
if (id == ImFontAtlasRectId_Invalid)
|
||||
return NULL;
|
||||
int index_idx = ImFontAtlasRectId_GetIndex(id);
|
||||
int generation = ImFontAtlasRectId_GetGeneration(id);
|
||||
ImFontAtlasBuilder* builder = (ImFontAtlasBuilder*)atlas->Builder;
|
||||
if (index_idx >= builder->RectsIndex.Size)
|
||||
return NULL;
|
||||
ImFontAtlasRectEntry* index_entry = &builder->RectsIndex[index_idx];
|
||||
if (index_entry->Generation != generation || !index_entry->IsUsed)
|
||||
if (index_entry->Generation != ImFontAtlasRectId_GetGeneration(id) || !index_entry->IsUsed)
|
||||
return NULL;
|
||||
return &builder->Rects[index_entry->TargetIndex];
|
||||
}
|
||||
|
Reference in New Issue
Block a user