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
+5 -1
View File
@@ -8844,7 +8844,11 @@ function ImGui.PushStyleVar(idx, val)
end
local var = g.Style[var_info.Key]
g.StyleVarStack:push_back(ImGuiStyleMod(idx, var))
g.Style[var_info.Key] = val
if type(val) == "number" then
g.Style[var_info.Key] = val
else -- copy into the style's own ImVec2: storing the caller's vector would alias it into the style forever
var.x = val.x; var.y = val.y
end
end
--- @param idx ImGuiStyleVar