Clipper, Nav: fixed an UBSan warning when using in a ListClipper region . (#9160)

This commit is contained in:
ocornut
2026-02-02 17:24:32 +01:00
parent 4b8e41cffb
commit 76860017d5
3 changed files with 4 additions and 2 deletions

View File

@@ -3399,7 +3399,8 @@ static bool ImGuiListClipper_StepInternal(ImGuiListClipper* clipper)
if (is_nav_request)
{
data->Ranges.push_back(ImGuiListClipperRange::FromPositions(g.NavScoringRect.Min.y, g.NavScoringRect.Max.y, nav_off_min, nav_off_max));
data->Ranges.push_back(ImGuiListClipperRange::FromPositions(g.NavScoringNoClipRect.Min.y, g.NavScoringNoClipRect.Max.y, nav_off_min, nav_off_max));
if (!g.NavScoringNoClipRect.IsInverted())
data->Ranges.push_back(ImGuiListClipperRange::FromPositions(g.NavScoringNoClipRect.Min.y, g.NavScoringNoClipRect.Max.y, nav_off_min, nav_off_max));
}
if (is_nav_request && (g.NavMoveFlags & ImGuiNavMoveFlags_IsTabbing) && g.NavTabbingDir == -1)
data->Ranges.push_back(ImGuiListClipperRange::FromIndices(clipper->ItemsCount - 1, clipper->ItemsCount));