mirror of
https://github.com/ocornut/imgui.git
synced 2025-02-17 19:09:27 +01:00
Child window explicitly inherit collapse state from parent.
This commit is contained in:
parent
364d4a1ae6
commit
2ae0e667d0
@ -3045,8 +3045,10 @@ bool ImGui::Begin(const char* name, bool* p_opened, ImVec2 size, float fill_alph
|
|||||||
if (flags & ImGuiWindowFlags_ChildWindow)
|
if (flags & ImGuiWindowFlags_ChildWindow)
|
||||||
{
|
{
|
||||||
IM_ASSERT((flags & ImGuiWindowFlags_NoTitleBar) != 0);
|
IM_ASSERT((flags & ImGuiWindowFlags_NoTitleBar) != 0);
|
||||||
|
window->Collapsed = parent_window && parent_window->Collapsed;
|
||||||
|
|
||||||
const ImVec4 clip_rect_t = window->ClipRectStack.back();
|
const ImVec4 clip_rect_t = window->ClipRectStack.back();
|
||||||
window->Collapsed = (clip_rect_t.x >= clip_rect_t.z || clip_rect_t.y >= clip_rect_t.w);
|
window->Collapsed |= (clip_rect_t.x >= clip_rect_t.z || clip_rect_t.y >= clip_rect_t.w);
|
||||||
|
|
||||||
// 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 simpler at this point)
|
// (we could perform the check earlier in the function but it is simpler at this point)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user