mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 08:33:55 +09:00
Ensure visible items is greater than zero before trying to display a range
This commit is contained in:
@ -590,6 +590,8 @@ namespace osu.Game.Screens.Select
|
|||||||
{
|
{
|
||||||
displayedRange = newDisplayRange;
|
displayedRange = newDisplayRange;
|
||||||
|
|
||||||
|
if (visibleItems.Count > 0)
|
||||||
|
{
|
||||||
var toDisplay = visibleItems.GetRange(displayedRange.first, displayedRange.last - displayedRange.first + 1);
|
var toDisplay = visibleItems.GetRange(displayedRange.first, displayedRange.last - displayedRange.first + 1);
|
||||||
|
|
||||||
foreach (var panel in ScrollableContent.Children)
|
foreach (var panel in ScrollableContent.Children)
|
||||||
@ -621,6 +623,7 @@ namespace osu.Game.Screens.Select
|
|||||||
ScrollableContent.Add(panel);
|
ScrollableContent.Add(panel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Finally, if the filtered items have changed, animate drawables to their new locations.
|
// Finally, if the filtered items have changed, animate drawables to their new locations.
|
||||||
// This is common if a selected/collapsed state has changed.
|
// This is common if a selected/collapsed state has changed.
|
||||||
|
Reference in New Issue
Block a user