diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index f5d620027..1a92b7f40 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -99,6 +99,9 @@ Other Changes: on inner rectangle rather than clipping rectangle, ensuring consistent (but occasionally less practical) navigation result when a window is partially out of screen. (#787) + - Improved/clarified behavior when requesting PageUp/PageDown from a + focused item which is outside of visible boundaries: now ends up one + page away from focused item. (#9079) - Clipper: fixed an issue when using up/down from an item outside of visible bound and using the clipper. (#9079) - Fonts: diff --git a/imgui.cpp b/imgui.cpp index f9b65c484..170bca0fd 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -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);