| 20430 | } |
| 20431 | |
| 20432 | ImGuiDockNode* ImGui::DockNodeTreeFindVisibleNodeByPos(ImGuiDockNode* node, ImVec2 pos) |
| 20433 | { |
| 20434 | if (!node->IsVisible) |
| 20435 | return NULL; |
| 20436 | |
| 20437 | const float dock_spacing = 0.0f;// g.Style.ItemInnerSpacing.x; // FIXME: Relation to DOCKING_SPLITTER_SIZE? |
| 20438 | ImRect r(node->Pos, node->Pos + node->Size); |
| 20439 | r.Expand(dock_spacing * 0.5f); |
| 20440 | bool inside = r.Contains(pos); |
| 20441 | if (!inside) |
| 20442 | return NULL; |
| 20443 | |
| 20444 | if (node->IsLeafNode()) |
| 20445 | return node; |
| 20446 | if (ImGuiDockNode* hovered_node = DockNodeTreeFindVisibleNodeByPos(node->ChildNodes[0], pos)) |
| 20447 | return hovered_node; |
| 20448 | if (ImGuiDockNode* hovered_node = DockNodeTreeFindVisibleNodeByPos(node->ChildNodes[1], pos)) |
| 20449 | return hovered_node; |
| 20450 | |
| 20451 | // This means we are hovering over the splitter/spacing of a parent node |
| 20452 | return node; |
| 20453 | } |
| 20454 | |
| 20455 | //----------------------------------------------------------------------------- |
| 20456 | // Docking: Public Functions (SetWindowDock, DockSpace, DockSpaceOverViewport) |