Fix PushStyleVar aliasing the caller's ImVec2 into the style; fix DebugNodeFontGlyph crash
This commit is contained in:
1 parent
1d293c8cbe
commit
7b41ae468c
5 files changed
+61
-7
No files matched your search
+5
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user