1
0
Fork 0
mirror of https://github.com/ocornut/imgui.git synced 2026-01-11 00:04:24 +00:00

Fonts: fixed assertion failure when ImFontAtlasRectEntry::Generation overflows. (#8906)

This commit is contained in:
Christian Fillion 2025-08-27 00:05:30 -04:00 committed by ocornut
parent 87c1ab7988
commit a309d2dcac
3 changed files with 9 additions and 5 deletions

View file

@ -4293,6 +4293,8 @@ void ImFontAtlasPackDiscardRect(ImFontAtlas* atlas, ImFontAtlasRectId id)
index_entry->IsUsed = false;
index_entry->TargetIndex = builder->RectsIndexFreeListStart;
index_entry->Generation++;
if (index_entry->Generation == 0)
index_entry->Generation++; // Keep non-zero on overflow
const int pack_padding = atlas->TexGlyphPadding;
builder->RectsIndexFreeListStart = index_idx;