From 84e8802891f4e05dc0e006019cd99bfb00ea6911 Mon Sep 17 00:00:00 2001 From: GamingMinds-DanielC Date: Thu, 14 Jan 2021 17:42:59 +0100 Subject: [PATCH] Docking: on node split, update memorized DockId for currently closed windows (#3716) Amended by @ocornut with same fix in DockBuilderRemoveNodeChildNodes(). --- imgui.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/imgui.cpp b/imgui.cpp index 483202a2..2c812726 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -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]); 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); // 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) DockContextQueueNotifyRemovedNode(ctx, node); if (root_node) + { DockNodeMoveWindows(root_node, node); + DockSettingsRenameNodeReferences(node->ID, root_node->ID); + } nodes_to_remove.push_back(node); } }