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

docking
omar 7 years ago
parent c3105919ba
commit d91b093be6

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

Loading…
Cancel
Save