Nav: Minor tweaks in NavProcessItem() used by ItemAdd()

This commit is contained in:
omar 2017-10-06 14:56:25 -07:00
parent c3105919ba
commit d91b093be6

View File

@ -2191,16 +2191,15 @@ static void NavProcessItem(ImGuiWindow* window, const ImRect& nav_bb, const ImGu
}
// Scoring for navigation
bool new_best = false;
if (g.NavId != id)
{
#if IMGUI_DEBUG_NAV
// [DEBUG] Score items at all times
// [DEBUG] Score all items in NavWindow at all times
if (!g.NavMoveRequest)
g.NavMoveDir = g.NavMoveDirLast;
if (g.NavId != id)
new_best = NavScoreItem(nav_bb) && g.NavMoveRequest;
bool new_best = NavScoreItem(nav_bb) && g.NavMoveRequest;
#else
if (g.NavMoveRequest && g.NavId != id)
new_best = NavScoreItem(nav_bb);
bool new_best = g.NavMoveRequest && NavScoreItem(nav_bb);
#endif
if (new_best)
{
@ -2208,6 +2207,7 @@ static void NavProcessItem(ImGuiWindow* window, const ImRect& nav_bb, const ImGu
g.NavMoveResultParentId = window->IDStack.back();
g.NavMoveResultRectRel = nav_bb_rel;
}
}
// Update window-relative bounding box of navigated item
if (g.NavId == id)