12 if (!leaf_rect.Contains(mouse))
15 const float width = leaf_rect.GetWidth();
16 const float height = leaf_rect.GetHeight();
17 if (width <= 0.0f || height <= 0.0f)
20 const float u = (mouse.x - leaf_rect.Min.x) / width;
21 const float v = (mouse.y - leaf_rect.Min.y) / height;
24 const float du = std::min(u, 1.0f - u);
25 const float dv = std::min(v, 1.0f - v);
46 switch (suggestion.
kind) {
48 return ImRect(leaf_rect.Min, leaf_rect.Min);
53 return ImRect(leaf_rect.Min,
54 ImVec2(leaf_rect.Min.x + w, leaf_rect.Max.y));
58 return ImRect(ImVec2(leaf_rect.Max.x - w, leaf_rect.Min.y),
63 return ImRect(leaf_rect.Min,
64 ImVec2(leaf_rect.Max.x, leaf_rect.Min.y + h));
68 return ImRect(ImVec2(leaf_rect.Min.x, leaf_rect.Max.y - h),
72 return ImRect(leaf_rect.Min, leaf_rect.Min);