Docking: Fixed an issue where windows docked into a node that's part of their dockspace wouldn't recover their order correctly after init. (#2109)

(It only worked on floating dock node for the accidental reason that BeginDocked would generally early out on the first frame)
This commit is contained in:
Tom Watson 2019-03-13 10:02:04 -07:00 committed by omar
parent 26646f2450
commit f20725eada

View File

@ -13507,8 +13507,9 @@ void ImGui::BeginDocked(ImGuiWindow* window, bool* p_open)
else else
window->Flags &= ~ImGuiWindowFlags_NoTitleBar; // Clear the NoTitleBar flag in case the user set it: confusingly enough we need a title bar height so we are correctly offset, but it won't be displayed! window->Flags &= ~ImGuiWindowFlags_NoTitleBar; // Clear the NoTitleBar flag in case the user set it: confusingly enough we need a title bar height so we are correctly offset, but it won't be displayed!
// Save new dock order only if the tab bar is active // Save new dock order only if the tab bar has been visible once.
if (node->TabBar) // This allows multiple windows to be created in the same frame and have their respective dock orders preserved.
if (node->TabBar && node->TabBar->CurrFrameVisible != -1)
window->DockOrder = (short)DockNodeGetTabOrder(window); window->DockOrder = (short)DockNodeGetTabOrder(window);
if ((node->WantCloseAll || node->WantCloseTabID == window->ID) && p_open != NULL) if ((node->WantCloseAll || node->WantCloseTabID == window->ID) && p_open != NULL)