Skip to content

Commit

Permalink
Docking: on node split, update memorized DockId for currently closed …
Browse files Browse the repository at this point in the history
…windows (#3716)

Amended by @ocornut with same fix in DockBuilderRemoveNodeChildNodes().
  • Loading branch information
GamingMinds-DanielC authored and ocornut committed Feb 1, 2021
1 parent 577e7cb commit 84e8802
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 84e8802

Please sign in to comment.