Docking: fixed calling DockContextCalcDropPosForDocking() with window in node without passing its node.

This commit is contained in:
ocornut 2023-09-20 17:27:55 +02:00
parent 61acb34e32
commit 2c0007731f
1 changed files with 3 additions and 0 deletions

View File

@ -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)