Bläddra i källkod

DrawList, Fonts: fixed PushFont()/AddImage() not restoring correct atlas texture id when using multiple atlas (#8694)

This also needs 24f7328.
ocornut 1 månad sedan
förälder
incheckning
fe048efeab
2 ändrade filer med 4 tillägg och 0 borttagningar
  1. 3 0
      docs/CHANGELOG.txt
  2. 1 0
      imgui_draw.cpp

+ 3 - 0
docs/CHANGELOG.txt

@@ -161,6 +161,9 @@ Breaking changes:
      - renamed ImGuiFreeType::GetBuilderForFreeType() to ImGuiFreeType::GetFontLoader()
      - renamed ImGuiFreeType::GetBuilderForFreeType() to ImGuiFreeType::GetFontLoader()
        - old:  io.Fonts->FontBuilderIO = ImGuiFreeType::GetBuilderForFreeType()
        - old:  io.Fonts->FontBuilderIO = ImGuiFreeType::GetBuilderForFreeType()
        - new:  io.Fonts.FontLoader = ImGuiFreeType::GetFontLoader();
        - new:  io.Fonts.FontLoader = ImGuiFreeType::GetFontLoader();
+- DrawList: Fixed a regression from 1.91.1 where a Begin()/PushFont()/AddImage() sequence 
+  would not restore the correct atlas Texture Identifier when the PushFont() call used 
+  a font from a different atlas. (#8694, caused by #3224, #3875, #6398, #7903)
 - DrawList: Renamed ImDrawList::PushTextureID()/PopTextureID() to PushTexture()/PopTexture().
 - DrawList: Renamed ImDrawList::PushTextureID()/PopTextureID() to PushTexture()/PopTexture().
 - Fonts: (users of custom rectangles)
 - Fonts: (users of custom rectangles)
   - Renamed AddCustomRectRegular() to AddCustomRect(). (#8466)
   - Renamed AddCustomRectRegular() to AddCustomRect(). (#8466)

+ 1 - 0
imgui_draw.cpp

@@ -695,6 +695,7 @@ void ImDrawList::_SetTexture(ImTextureRef tex_ref)
     if (_CmdHeader.TexRef == tex_ref)
     if (_CmdHeader.TexRef == tex_ref)
         return;
         return;
     _CmdHeader.TexRef = tex_ref;
     _CmdHeader.TexRef = tex_ref;
+    _TextureStack.back() = tex_ref;
     _OnChangedTexture();
     _OnChangedTexture();
 }
 }