Docking: set node.LastBgColor (closing dock hosts drew white bodies), host skips own bg, fix SetNextWindowBgAlpha; Roblox backend: frames skipped by the render rate cap are drawn later (UI could freeze when the app stopped rendering); t_dock_close test
This commit is contained in:
@@ -862,7 +862,8 @@ function ImGui_ImplRoblox_RenderDrawData(draw_data)
|
||||
end
|
||||
if rate > 0 then
|
||||
local now = os.clock()
|
||||
if now + 0.002 < bd.NextRender then table.clear(bd.Overlays); PE(); return end
|
||||
-- Skipped: kept pending, so if no new frame comes (the app stopped rendering) Heartbeat still draws it
|
||||
if now + 0.002 < bd.NextRender then bd.Pending = draw_data; PE(); return end
|
||||
bd.NextRender = math.max(bd.NextRender + 1 / rate, now)
|
||||
end
|
||||
|
||||
@@ -1129,6 +1130,16 @@ function ImGui_ImplRoblox_Init(parent, render_scale)
|
||||
|
||||
bd.PendingChars = {}
|
||||
|
||||
-- Render rate cap trailing edge: the last frame submitted is always drawn, even if it was skipped and the app
|
||||
-- then stopped calling NewFrame (e.g. it rendered one empty frame to hide its windows)
|
||||
connect(game:GetService("RunService").Heartbeat, function()
|
||||
local d = bd.Pending
|
||||
if d and os.clock() + 0.002 >= bd.NextRender then
|
||||
bd.Pending = nil
|
||||
ImGui_ImplRoblox_RenderDrawData(d)
|
||||
end
|
||||
end)
|
||||
|
||||
connect(UserInputService.WindowFocused, function() ImGui.GetIO():AddFocusEvent(true) end)
|
||||
connect(UserInputService.WindowFocusReleased, function() ImGui.GetIO():AddFocusEvent(false) end)
|
||||
end
|
||||
@@ -1188,6 +1199,7 @@ function ImGui_ImplRoblox_NewFrame()
|
||||
PB("ImGui NewFrame (backend)")
|
||||
local io = ImGui.GetIO()
|
||||
local bd = ImGui_ImplRoblox_GetBackendData()
|
||||
if bd.Pending then bd.Pending = nil; table.clear(bd.Overlays) end -- skipped frame superseded (its draw lists get reset)
|
||||
|
||||
local screen = bd.Gui.AbsoluteSize
|
||||
local w, h = floor(screen.X * bd.Scale), floor(screen.Y * bd.Scale)
|
||||
|
||||
Reference in New Issue
Block a user