mirror of
https://github.com/ocornut/imgui.git
synced 2025-02-22 05:09:56 +01:00
Fixes f422e78. Didn't crash because g.Windows[] is always larger than g.WindowsFocusOrder[].
This commit is contained in:
parent
475453668d
commit
762ec445e6
@ -5341,20 +5341,16 @@ void ImGui::Render()
|
|||||||
CallContextHooks(&g, ImGuiContextHookType_RenderPre);
|
CallContextHooks(&g, ImGuiContextHookType_RenderPre);
|
||||||
|
|
||||||
// Add background ImDrawList (for each active viewport)
|
// Add background ImDrawList (for each active viewport)
|
||||||
for (int n = 0; n != g.Viewports.Size; n++)
|
for (ImGuiViewportP* viewport : g.Viewports)
|
||||||
{
|
{
|
||||||
ImGuiViewportP* viewport = g.Viewports[n];
|
|
||||||
InitViewportDrawData(viewport);
|
InitViewportDrawData(viewport);
|
||||||
if (viewport->BgFgDrawLists[0] != NULL)
|
if (viewport->BgFgDrawLists[0] != NULL)
|
||||||
AddDrawListToDrawDataEx(&viewport->DrawDataP, viewport->DrawDataBuilder.Layers[0], GetBackgroundDrawList(viewport));
|
AddDrawListToDrawDataEx(&viewport->DrawDataP, viewport->DrawDataBuilder.Layers[0], GetBackgroundDrawList(viewport));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int n = 0; n != g.WindowsFocusOrder.Size; n++)
|
for (ImGuiWindow* window : g.WindowsFocusOrder)
|
||||||
{
|
|
||||||
ImGuiWindow* window = g.Windows[n];
|
|
||||||
if (window->Flags & ImGuiWindowFlags_DockNodeHost)
|
if (window->Flags & ImGuiWindowFlags_DockNodeHost)
|
||||||
window->DrawList->ChannelsMerge();
|
window->DrawList->ChannelsMerge();
|
||||||
}
|
|
||||||
|
|
||||||
// Draw modal/window whitening backgrounds
|
// Draw modal/window whitening backgrounds
|
||||||
RenderDimmedBackgrounds();
|
RenderDimmedBackgrounds();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user