Преглед изворни кода

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
Christian Fillion пре 2 месеци
родитељ
комит
22fe9fce4c
2 измењених фајлова са 3 додато и 0 уклоњено
  1. 2 0
      docs/CHANGELOG.txt
  2. 1 0
      imgui_draw.cpp

+ 2 - 0
docs/CHANGELOG.txt

@@ -49,6 +49,8 @@ Other Changes:
 - Windows: fixed an issue where resizable child windows would emit border
 - 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
   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)
   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
 - Tables: fixed TableGetRowIndex() which never correctly worked when using
   a clipper (it exists for consistency but is almost never used, as it is 
   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()
   often more convenient to use index in caller-code, whereas TableGetRowIndex()

+ 1 - 0
imgui_draw.cpp

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