Fix PushStyleVar aliasing the caller's ImVec2 into the style; fix DebugNodeFontGlyph crash

This commit is contained in:
4DBug
2026-10-08 09:27:57 -05:00
parent 1dd48be9b8
commit 3fca191b86
5 changed files with 61 additions and 7 deletions
+2 -2
View File
@@ -127,8 +127,8 @@ function ImGui.DebugNodeFontGlyph(font, glyph)
ImGui.Text("Pos: (%.2f,%.2f)->(%.2f,%.2f)", glyph.X0, glyph.Y0, glyph.X1, glyph.Y1)
ImGui.Text("UV: (%.3f,%.3f)->(%.3f,%.3f)", glyph.U0, glyph.V0, glyph.U1, glyph.V1)
if glyph.PackId >= 0 then
local r = ImFontAtlasPackGetRect(font.OwnerAtlas, glyph.PackId)
if r then ImGui.Text("PackId: 0x%X (%dx%d rect at %d,%d)", glyph.PackId, r.w, r.h, r.x, r.y) end
local r = { uv0 = ImVec2(), uv1 = ImVec2() }
if font.OwnerAtlas:GetCustomRect(glyph.PackId, r) then ImGui.Text("PackId: 0x%X (%dx%d rect at %d,%d)", glyph.PackId, r.w, r.h, r.x, r.y) end
end
ImGui.Text("SourceIdx: %d", glyph.SourceIdx)
end