mirror of
https://github.com/ocornut/imgui.git
synced 2025-12-17 11:55:35 +00:00
Nav: improved/clarified behavior when requesting PageUp/PageDown from a focused item which is outside of visible boundaries. (#9079)
This commit is contained in:
@@ -13815,11 +13815,6 @@ void ImGui::NavUpdateCreateMoveRequest()
|
||||
float scoring_page_offset_y = 0.0f;
|
||||
if (window && g.NavMoveDir == ImGuiDir_None && nav_keyboard_active)
|
||||
scoring_page_offset_y = NavUpdatePageUpPageDown();
|
||||
if (scoring_page_offset_y != 0.0f)
|
||||
{
|
||||
g.NavScoringNoClipRect = window->InnerRect;
|
||||
g.NavScoringNoClipRect.TranslateY(scoring_page_offset_y);
|
||||
}
|
||||
|
||||
// [DEBUG] Always send a request when holding Ctrl. Hold Ctrl + Arrow change the direction.
|
||||
#if IMGUI_DEBUG_NAV_SCORING
|
||||
@@ -13883,7 +13878,11 @@ void ImGui::NavUpdateCreateMoveRequest()
|
||||
{
|
||||
ImRect nav_rect_rel = !window->NavRectRel[g.NavLayer].IsInverted() ? window->NavRectRel[g.NavLayer] : ImRect(0, 0, 0, 0);
|
||||
scoring_rect = WindowRectRelToAbs(window, nav_rect_rel);
|
||||
if (scoring_page_offset_y != 0.0f)
|
||||
g.NavScoringNoClipRect = scoring_rect;
|
||||
scoring_rect.TranslateY(scoring_page_offset_y);
|
||||
if (scoring_page_offset_y != 0.0f)
|
||||
g.NavScoringNoClipRect.Add(scoring_rect);
|
||||
//GetForegroundDrawList()->AddRectFilled(scoring_rect.Min - ImVec2(1, 1), scoring_rect.Max + ImVec2(1, 1), IM_COL32(255, 100, 0, 80)); // [DEBUG] Pre-bias
|
||||
if (g.NavMoveSubmitted)
|
||||
NavBiasScoringRect(scoring_rect, window->RootWindowForNav->NavPreferredScoringPosRel[g.NavLayer], g.NavMoveDir, g.NavMoveFlags);
|
||||
|
||||
Reference in New Issue
Block a user