20 ImVec2 mouse,
float tolerance) {
26 const auto split_it = layout.
node_rects.find(node);
32 if (a ==
nullptr || b ==
nullptr)
44 if (walk(a) || walk(b))
47 const ImRect& split_rect = split_it->second;
48 const ImRect& a_rect = a_it->second;
49 const ImRect& b_rect = b_it->second;
50 const bool horizontal = IsHorizontalSplit(node->split_direction);
56 const float a_axis = horizontal ? a_rect.GetWidth() : a_rect.GetHeight();
57 const float b_axis = horizontal ? b_rect.GetWidth() : b_rect.GetHeight();
58 const float effective_tol =
59 std::min(tolerance, std::min(a_axis, b_axis) * 0.25f);
61 const float gutter_x = a_rect.Max.x;
62 if (std::abs(mouse.x - gutter_x) <= effective_tol &&
63 mouse.y >= split_rect.Min.y && mouse.y <= split_rect.Max.y) {
69 const float gutter_y = a_rect.Max.y;
70 if (std::abs(mouse.y - gutter_y) <= effective_tol &&
71 mouse.x >= split_rect.Min.x && mouse.x <= split_rect.Max.x) {
80 walk(tree.
root.get());