Invisible child windows gets clipped earlier in the pipeline.

This commit is contained in:
ocornut 2014-08-17 14:02:32 +01:00
parent 931a4c5b49
commit f6414f2011

View File

@ -1003,7 +1003,7 @@ void ImGuiWindow::AddToRenderList()
for (size_t i = 0; i < DC.ChildWindows.size(); i++) for (size_t i = 0; i < DC.ChildWindows.size(); i++)
{ {
ImGuiWindow* child = DC.ChildWindows[i]; ImGuiWindow* child = DC.ChildWindows[i];
IM_ASSERT(child->Visible); // Shouldn't be in this list if we are not active this frame if (child->Visible) // clipped childs may have been marked not Visible
child->AddToRenderList(); child->AddToRenderList();
} }
} }
@ -1334,6 +1334,7 @@ static void AddWindowToSortedBuffer(ImGuiWindow* window, ImVector<ImGuiWindow*>&
for (size_t i = 0; i < window->DC.ChildWindows.size(); i++) for (size_t i = 0; i < window->DC.ChildWindows.size(); i++)
{ {
ImGuiWindow* child = window->DC.ChildWindows[i]; ImGuiWindow* child = window->DC.ChildWindows[i];
if (child->Visible)
AddWindowToSortedBuffer(child, sorted_windows); AddWindowToSortedBuffer(child, sorted_windows);
} }
} }
@ -2176,8 +2177,8 @@ bool Begin(const char* name, bool* open, ImVec2 size, float fill_alpha, ImGuiWin
// We also hide the window from rendering because we've already added its border to the command list. // We also hide the window from rendering because we've already added its border to the command list.
// (we could perform the check earlier in the function but it is simplier at this point) // (we could perform the check earlier in the function but it is simplier at this point)
// FIXME-WIP // FIXME-WIP
//if (window->Collapsed) if (window->Collapsed)
// window->Visible = false; window->Visible = false;
} }
// Return collapsed so that user can perform an early out optimisation // Return collapsed so that user can perform an early out optimisation