Browse Source

Internals: Cleanup FindBestPopupWindowPos() to be more digestible, since we are bounds to rework the logic there. No functional changes intended. FIXED TYPO.

pull/1414/merge
omar 7 years ago
parent
commit
3c9f9a455e
  1. 2
      imgui.cpp

2
imgui.cpp

@ -4037,7 +4037,7 @@ static ImVec2 FindBestPopupWindowPos(const ImVec2& base_pos, const ImVec2& size,
float avail_w = (dir == ImGuiDir_Left ? r_avoid.Min.x : r_outer.Max.x) - (dir == ImGuiDir_Right ? r_avoid.Max.x : r_outer.Min.x);
if (avail_w < size.x)
continue;
float avail_h = (dir == ImGuiDir_Down ? r_avoid.Min.y : r_outer.Max.y) - (dir == ImGuiDir_Down ? r_avoid.Max.y : r_outer.Min.y);
float avail_h = (dir == ImGuiDir_Up ? r_avoid.Min.y : r_outer.Max.y) - (dir == ImGuiDir_Down ? r_avoid.Max.y : r_outer.Min.y);
if (avail_h < size.y)
continue;

Loading…
Cancel
Save