Make it possible to use SetNextWindowPos() on a child window. Useful internally.
This commit is contained in:
parent
27fd1b913b
commit
5ea6e80da1
@ -4293,7 +4293,10 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
||||
window->SizeFull = CalcSizeFullWithConstraint(window, window->SizeFull);
|
||||
window->Size = window->Collapsed ? window->TitleBarRect().GetSize() : window->SizeFull;
|
||||
if ((flags & ImGuiWindowFlags_ChildWindow) && !(flags & ImGuiWindowFlags_Popup))
|
||||
{
|
||||
IM_ASSERT(window_size_set_by_api); // Submitted by BeginChild()
|
||||
window->Size = window->SizeFull;
|
||||
}
|
||||
|
||||
// SCROLLBAR STATUS
|
||||
|
||||
@ -4316,11 +4319,8 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
||||
window->OrderWithinParent = parent_window->DC.ChildWindows.Size;
|
||||
parent_window->DC.ChildWindows.push_back(window);
|
||||
}
|
||||
if ((flags & ImGuiWindowFlags_ChildWindow) && !(flags & ImGuiWindowFlags_Popup))
|
||||
{
|
||||
IM_ASSERT(window_size_set_by_api); // Submitted by BeginChild()
|
||||
if ((flags & ImGuiWindowFlags_ChildWindow) && !(flags & ImGuiWindowFlags_Popup) && !window_pos_set_by_api)
|
||||
window->Pos = window->PosFloat = parent_window->DC.CursorPos;
|
||||
}
|
||||
|
||||
const bool window_pos_with_pivot = (window->SetWindowPosVal.x != FLT_MAX && window->HiddenFrames == 0);
|
||||
if (window_pos_with_pivot)
|
||||
|
Loading…
Reference in New Issue
Block a user