From d9a741aa0e4a50109a9d28d173ca7e190c1f330f Mon Sep 17 00:00:00 2001 From: 4DBug <4DBug@github.com> Date: Thu, 8 Oct 2026 10:33:05 -0500 Subject: [PATCH] Fix StyleCopy for named-field vectors (Style Editor assert) --- build/ImGui.luau | 2 +- imgui/imgui_demo_widgets.lua | 2 +- tools/test/scripts/t_style_editor.luau | 11 +++++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 tools/test/scripts/t_style_editor.luau diff --git a/build/ImGui.luau b/build/ImGui.luau index a2bc909..e3f31ce 100644 --- a/build/ImGui.luau +++ b/build/ImGui.luau @@ -21982,7 +21982,7 @@ local function StyleCopy(dst, src) elseif type(v) == "table" and getmetatable(v) ~= nil and type(v[1]) == "number" then local c = dst[k] if type(c) ~= "table" then c = setmetatable({}, getmetatable(v)); dst[k] = c end - for _, key in ipairs({ "x", "y", "z", "w" }) do if rawget(v, key) ~= nil then c[key] = v[key] end end + for _, key in ipairs({ "x", "y", "z", "w" }) do if rawget(v, key) ~= nil then rawset(c, key, rawget(v, key)) end end else dst[k] = v end diff --git a/imgui/imgui_demo_widgets.lua b/imgui/imgui_demo_widgets.lua index 14140ac..3f7685a 100644 --- a/imgui/imgui_demo_widgets.lua +++ b/imgui/imgui_demo_widgets.lua @@ -1629,7 +1629,7 @@ local function StyleCopy(dst, src) elseif type(v) == "table" and getmetatable(v) ~= nil and type(v[1]) == "number" then local c = dst[k] if type(c) ~= "table" then c = setmetatable({}, getmetatable(v)); dst[k] = c end - for _, key in ipairs({ "x", "y", "z", "w" }) do if rawget(v, key) ~= nil then c[key] = v[key] end end + for _, key in ipairs({ "x", "y", "z", "w" }) do if rawget(v, key) ~= nil then rawset(c, key, rawget(v, key)) end end else dst[k] = v end diff --git a/tools/test/scripts/t_style_editor.luau b/tools/test/scripts/t_style_editor.luau new file mode 100644 index 0000000..65d87e2 --- /dev/null +++ b/tools/test/scripts/t_style_editor.luau @@ -0,0 +1,11 @@ +local G = require(game:GetService("ReplicatedStorage"):WaitForChild("ImGui")) +local ImGui = G.ImGui +ImGui.CreateContext(); G.ImGui_ImplRoblox.Init() +local f = 0 +game:GetService("RunService").Stepped:Connect(function() + f += 1 + G.ImGui_ImplRoblox.NewFrame(); ImGui.NewFrame() + ImGui.Begin("SE"); ImGui.ShowStyleEditor(); ImGui.End() + ImGui.Render(); G.ImGui_ImplRoblox.RenderDrawData(ImGui.GetDrawData()) + if f == 10 then print("SE OK") end +end)