Textures: fixed assertion in DebugNodeTexture() when ImTextureID_Invalid is non-zero. (#8860, #8745)

ImFontAtlas's constructor resets ImTextureRef::_TexID to 0 instead of ImTextureID_Invalid.
Amend bc051dc
This commit is contained in:
Christian Fillion
2025-08-04 00:57:44 -04:00
committed by ocornut
parent 320c94bfaa
commit 22fe9fce4c
2 changed files with 3 additions and 0 deletions

View File

@@ -49,6 +49,8 @@ Other Changes:
- Windows: fixed an issue where resizable child windows would emit border
logic when hidden/non-visible (e.g. when in a docked window that is not
selected), impacting code not checking for BeginChild() return value. (#8815)
- Textures: Fixed support for `#define ImTextureID_Invalid` to non-zero value:
ImFontAtlas() was incorrectly cleared with zeroes. (#8860, #8745) [@cfillion]
- Tables: fixed TableGetRowIndex() which never correctly worked when using
a clipper (it exists for consistency but is almost never used, as it is
often more convenient to use index in caller-code, whereas TableGetRowIndex()

View File

@@ -2631,6 +2631,7 @@ ImFontAtlas::ImFontAtlas()
TexMinHeight = 128;
TexMaxWidth = 8192;
TexMaxHeight = 8192;
TexRef._TexID = ImTextureID_Invalid;
RendererHasTextures = false; // Assumed false by default, as apps can call e.g Atlas::Build() after backend init and before ImGui can update.
TexNextUniqueID = 1;
FontNextUniqueID = 1;