소스 검색

Docking: Fixed extracting a dock node from a document root: document root should be preserved.

omar 7 년 전
부모
커밋
ae657a349a
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      imgui.cpp

+ 2 - 2
imgui.cpp

@@ -10150,9 +10150,9 @@ void ImGui::DockContextProcessUndockNode(ImGuiContext* ctx, ImGuiDockNode* node)
     IM_ASSERT(!node->IsSplitNode());
     IM_ASSERT(node->Windows.Size >= 1);
 
-    // In the case of a root node, a node will have to stay in place. Create a new node for this purpose.
+    // In the case of a root node or document root, the node will have to stay in place. Create a new node to receive the payload.
     // Otherwise delete the previous node by merging the other sibling back into the parent node.
-    if (node->IsRootNode())
+    if (node->IsRootNode() || node->IsDocumentRoot)
     {
         // FIXME-DOCK: Transition persistent DockId for all non-active windows
         ImGuiDockNode* new_node = DockContextAddNode(ctx, 0);