Skip to content

Commit c3a3a39

Browse files
committed
Nav: fixed abnormal clipping disable over large ranges, could lead to stall. (#3841, #1725)
Amend 93cccd2
1 parent 19289d5 commit c3a3a39

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

docs/CHANGELOG.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ Other changes:
113113
CTRL+Tab windowing + pressing a keyboard key. (#8525)
114114
- Nav: fixed scroll fallback (when there are no interactive widgets to jump to) not
115115
being enabled on windows with menu or title bar.
116+
- Nav: fixed an issue handling PageUp/PageDown on windows with abnormally large contents
117+
range which could lead to clipper requesting very large ranges.
116118
- Error Handling: added better error report and recovery for extraneous
117119
EndPopup() call. (#1651, #8499)
118120
- Error Handling: added better error report and recovery when calling EndFrame()

imgui.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3229,7 +3229,10 @@ static bool ImGuiListClipper_StepInternal(ImGuiListClipper* clipper)
32293229
// Add range selected to be included for navigation
32303230
const bool is_nav_request = (g.NavMoveScoringItems && g.NavWindow && g.NavWindow->RootWindowForNav == window->RootWindowForNav);
32313231
if (is_nav_request)
3232+
{
3233+
data->Ranges.push_back(ImGuiListClipperRange::FromPositions(g.NavScoringRect.Min.y, g.NavScoringRect.Max.y, 0, 0));
32323234
data->Ranges.push_back(ImGuiListClipperRange::FromPositions(g.NavScoringNoClipRect.Min.y, g.NavScoringNoClipRect.Max.y, 0, 0));
3235+
}
32333236
if (is_nav_request && (g.NavMoveFlags & ImGuiNavMoveFlags_IsTabbing) && g.NavTabbingDir == -1)
32343237
data->Ranges.push_back(ImGuiListClipperRange::FromIndices(clipper->ItemsCount - 1, clipper->ItemsCount));
32353238

@@ -13379,7 +13382,7 @@ void ImGui::NavUpdateCreateMoveRequest()
1337913382
//if (!g.NavScoringNoClipRect.IsInverted()) { GetForegroundDrawList()->AddRect(g.NavScoringNoClipRect.Min, g.NavScoringNoClipRect.Max, IM_COL32(255, 200, 0, 255)); } // [DEBUG]
1338013383
}
1338113384
g.NavScoringRect = scoring_rect;
13382-
g.NavScoringNoClipRect.Add(scoring_rect);
13385+
//g.NavScoringNoClipRect.Add(scoring_rect);
1338313386
}
1338413387

1338513388
void ImGui::NavUpdateCreateTabbingRequest()

0 commit comments

Comments
 (0)