WIP Menus: Fixed style.WindowPadding == 0 leading to zero-sized initial clipping rectangle leading to self-collapsing childs (#126)

This commit is contained in:
ocornut 2015-05-24 23:56:29 +01:00
parent 9abcbf73cb
commit 0836f69d9b

View File

@ -3821,8 +3821,11 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
IM_ASSERT((flags & ImGuiWindowFlags_NoTitleBar) != 0);
window->Collapsed = parent_window && parent_window->Collapsed;
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);
if (!(flags & ImGuiWindowFlags_AlwaysAutoResize) && window->AutoFitFrames <= 0)
{
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);
}
// 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)