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:
@@ -99,6 +99,9 @@ Other Changes:
|
|||||||
on inner rectangle rather than clipping rectangle, ensuring consistent
|
on inner rectangle rather than clipping rectangle, ensuring consistent
|
||||||
(but occasionally less practical) navigation result when a window is
|
(but occasionally less practical) navigation result when a window is
|
||||||
partially out of screen. (#787)
|
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
|
- Clipper: fixed an issue when using up/down from an item outside of
|
||||||
visible bound and using the clipper. (#9079)
|
visible bound and using the clipper. (#9079)
|
||||||
- Fonts:
|
- Fonts:
|
||||||
|
|||||||
@@ -13815,11 +13815,6 @@ void ImGui::NavUpdateCreateMoveRequest()
|
|||||||
float scoring_page_offset_y = 0.0f;
|
float scoring_page_offset_y = 0.0f;
|
||||||
if (window && g.NavMoveDir == ImGuiDir_None && nav_keyboard_active)
|
if (window && g.NavMoveDir == ImGuiDir_None && nav_keyboard_active)
|
||||||
scoring_page_offset_y = NavUpdatePageUpPageDown();
|
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.
|
// [DEBUG] Always send a request when holding Ctrl. Hold Ctrl + Arrow change the direction.
|
||||||
#if IMGUI_DEBUG_NAV_SCORING
|
#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);
|
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);
|
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);
|
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
|
//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)
|
if (g.NavMoveSubmitted)
|
||||||
NavBiasScoringRect(scoring_rect, window->RootWindowForNav->NavPreferredScoringPosRel[g.NavLayer], g.NavMoveDir, g.NavMoveFlags);
|
NavBiasScoringRect(scoring_rect, window->RootWindowForNav->NavPreferredScoringPosRel[g.NavLayer], g.NavMoveDir, g.NavMoveFlags);
|
||||||
|
|||||||
Reference in New Issue
Block a user