Merge branch 'master' into navigation
This commit is contained in:
commit
1c95dea88c
21
imgui.cpp
21
imgui.cpp
@ -5486,14 +5486,6 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
||||
if ((flags & ImGuiWindowFlags_ChildWindow) && !(flags & (ImGuiWindowFlags_AlwaysUseWindowPadding | ImGuiWindowFlags_Popup)) && window->WindowBorderSize == 0.0f)
|
||||
window->WindowPadding = ImVec2(0.0f, (flags & ImGuiWindowFlags_MenuBar) ? style.WindowPadding.y : 0.0f);
|
||||
|
||||
if (window_just_activated_by_user)
|
||||
{
|
||||
// Popup first latch mouse position, will position itself when it appears next frame
|
||||
window->AutoPosLastDirection = ImGuiDir_None;
|
||||
if ((flags & ImGuiWindowFlags_Popup) != 0 && !window_pos_set_by_api)
|
||||
window->Pos = window->PosFloat = g.CurrentPopupStack.back().OpenPopupPos;
|
||||
}
|
||||
|
||||
// Collapse window by double-clicking on title bar
|
||||
// At this point we don't have a clipping rectangle setup yet, so we can use the title bar area for hit detection and drawing
|
||||
if (!(flags & ImGuiWindowFlags_NoTitleBar) && !(flags & ImGuiWindowFlags_NoCollapse))
|
||||
@ -5582,14 +5574,23 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
||||
|
||||
// POSITION
|
||||
|
||||
// Popup latch its initial position, will position itself when it appears next frame
|
||||
if (window_just_activated_by_user)
|
||||
{
|
||||
window->AutoPosLastDirection = ImGuiDir_None;
|
||||
if ((flags & ImGuiWindowFlags_Popup) != 0 && !window_pos_set_by_api)
|
||||
window->Pos = window->PosFloat = g.CurrentPopupStack.back().OpenPopupPos;
|
||||
}
|
||||
|
||||
// Position child window
|
||||
if (flags & ImGuiWindowFlags_ChildWindow)
|
||||
{
|
||||
window->BeginOrderWithinParent = parent_window->DC.ChildWindows.Size;
|
||||
parent_window->DC.ChildWindows.push_back(window);
|
||||
|
||||
if (!(flags & ImGuiWindowFlags_Popup) && !window_pos_set_by_api)
|
||||
window->Pos = window->PosFloat = parent_window->DC.CursorPos;
|
||||
}
|
||||
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