Docking: on node split, update memorized DockId for currently closed windows (#3716)

Amended by @ocornut with same fix in DockBuilderRemoveNodeChildNodes().
This commit is contained in:
GamingMinds-DanielC 2021-01-14 17:42:59 +01:00 committed by ocornut
parent 577e7cb493
commit 84e8802891

View File

@ -14190,6 +14190,7 @@ void ImGui::DockNodeTreeSplit(ImGuiContext* ctx, ImGuiDockNode* parent_node, ImG
child_1->SizeRef[split_axis] = ImFloor(size_avail - child_0->SizeRef[split_axis]); child_1->SizeRef[split_axis] = ImFloor(size_avail - child_0->SizeRef[split_axis]);
DockNodeMoveWindows(parent_node->ChildNodes[split_inheritor_child_idx], parent_node); DockNodeMoveWindows(parent_node->ChildNodes[split_inheritor_child_idx], parent_node);
DockSettingsRenameNodeReferences(parent_node->ID, parent_node->ChildNodes[split_inheritor_child_idx]->ID);
DockNodeTreeUpdatePosSize(parent_node, parent_node->Pos, parent_node->Size); DockNodeTreeUpdatePosSize(parent_node, parent_node->Pos, parent_node->Size);
// Flags transfer (e.g. this is where we transfer the ImGuiDockNodeFlags_CentralNode property) // Flags transfer (e.g. this is where we transfer the ImGuiDockNodeFlags_CentralNode property)
@ -14815,7 +14816,10 @@ void ImGui::DockBuilderRemoveNodeChildNodes(ImGuiID root_id)
if (root_id != 0) if (root_id != 0)
DockContextQueueNotifyRemovedNode(ctx, node); DockContextQueueNotifyRemovedNode(ctx, node);
if (root_node) if (root_node)
{
DockNodeMoveWindows(root_node, node); DockNodeMoveWindows(root_node, node);
DockSettingsRenameNodeReferences(node->ID, root_node->ID);
}
nodes_to_remove.push_back(node); nodes_to_remove.push_back(node);
} }
} }