Skip to content

Commit

Permalink
Shortcuts: fixed priority of route calculation (higher first). (#456, #…
Browse files Browse the repository at this point in the history
  • Loading branch information
ocornut committed May 24, 2024
1 parent ce4e210 commit 85d9820
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8633,21 +8633,22 @@ static int CalcRoutingScore(ImGuiID focus_scope_id, ImGuiID owner_id, ImGuiInput
for (int index_in_focus_path = 0; index_in_focus_path < g.NavFocusRoute.Size; index_in_focus_path++)
if (g.NavFocusRoute.Data[index_in_focus_path].ID == focus_scope_id)
return 3 + index_in_focus_path;

return 255;
}
if (flags & ImGuiInputFlags_RouteActive)
else if (flags & ImGuiInputFlags_RouteActive)
{
if (owner_id != 0 && g.ActiveId == owner_id)
return 1;
return 255;
}
if (flags & ImGuiInputFlags_RouteOverFocused)
return 2;
if (flags & ImGuiInputFlags_RouteGlobal)
else if (flags & ImGuiInputFlags_RouteGlobal)
{
if (flags & ImGuiInputFlags_RouteOverActive)
return 0;
if (flags & ImGuiInputFlags_RouteOverFocused)
return 2;
return 254;
if (flags & ImGuiInputFlags_RouteOverActive)
return 0;
}
IM_ASSERT(0);
return 0;
}
Expand Down

0 comments on commit 85d9820

Please sign in to comment.