From 2c0007731f464ec13bfd21976baac2244462440c Mon Sep 17 00:00:00 2001 From: ocornut Date: Wed, 20 Sep 2023 17:27:55 +0200 Subject: [PATCH] Docking: fixed calling DockContextCalcDropPosForDocking() with window in node without passing its node. --- imgui.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/imgui.cpp b/imgui.cpp index 527e9ebf1..cf12c099d 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -15813,6 +15813,9 @@ void ImGui::DockContextProcessUndockNode(ImGuiContext* ctx, ImGuiDockNode* node) // This is mostly used for automation. bool ImGui::DockContextCalcDropPosForDocking(ImGuiWindow* target, ImGuiDockNode* target_node, ImGuiWindow* payload_window, ImGuiDockNode* payload_node, ImGuiDir split_dir, bool split_outer, ImVec2* out_pos) { + if (target != NULL && target_node == NULL) + target_node = target->DockNode; + // In DockNodePreviewDockSetup() for a root central node instead of showing both "inner" and "outer" drop rects // (which would be functionally identical) we only show the outer one. Reflect this here. if (target_node && target_node->ParentNode == NULL && target_node->IsCentralNode() && split_dir != ImGuiDir_None)