mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-20 01:34:20 +00:00
Docking: Fixed an issue where removing the last window from a dockspace node that is not a central node without remove the node. (#2414, #2109)
This commit is contained in:
parent
d77d3416d3
commit
ecf7666624
2 changed files with 3 additions and 3 deletions
|
|
@ -11432,7 +11432,7 @@ static void ImGui::DockNodeRemoveWindow(ImGuiDockNode* node, ImGuiWindow* window
|
|||
}
|
||||
}
|
||||
|
||||
if (node->Windows.Size == 0 && !node->IsCentralNode && window->DockId != node->ID)
|
||||
if (node->Windows.Size == 0 && !node->IsCentralNode && !node->IsDockSpace() && window->DockId != node->ID)
|
||||
{
|
||||
// Automatic dock node delete themselves if they are not holding at least one tab
|
||||
DockContextRemoveNode(&g, node, true);
|
||||
|
|
@ -11631,7 +11631,7 @@ static void ImGui::DockNodeUpdateVisibleFlagAndInactiveChilds(ImGuiDockNode* nod
|
|||
static void ImGui::DockNodeUpdateVisibleFlag(ImGuiDockNode* node)
|
||||
{
|
||||
// Update visibility flag
|
||||
bool is_visible = (node->ParentNode == 0) ? node->IsDockSpace() : node->IsCentralNode;
|
||||
bool is_visible = (node->ParentNode == NULL) ? node->IsDockSpace() : node->IsCentralNode;
|
||||
is_visible |= (node->Windows.Size > 0);
|
||||
is_visible |= (node->ChildNodes[0] && node->ChildNodes[0]->IsVisible);
|
||||
is_visible |= (node->ChildNodes[1] && node->ChildNodes[1]->IsVisible);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue