Bring logic up-to-date

This commit is contained in:
Dean Herbert
2022-08-26 19:32:49 +09:00
parent a146db0e35
commit 217fa00a72
2 changed files with 10 additions and 26 deletions

View File

@ -120,16 +120,16 @@ namespace osu.Game.Screens.Select.Carousel
while (true)
{
// check if a direction has been exhausted and an item (or null) from the other direction should be returned
if (forwardsIndex >= Children.Count)
return Children.Reverse().Skip(Children.Count - backwardsIndex - 1).FirstOrDefault(item => !item.Filtered.Value);
if (forwardsIndex >= Items.Count)
return Items.Reverse().Skip(Items.Count - backwardsIndex - 1).FirstOrDefault(item => !item.Filtered.Value);
if (backwardsIndex < 0)
return Children.Skip(forwardsIndex).FirstOrDefault(item => !item.Filtered.Value);
return Items.Skip(forwardsIndex).FirstOrDefault(item => !item.Filtered.Value);
// check if an unfiltered item has been reached
if (!Children[forwardsIndex].Filtered.Value)
return Children[forwardsIndex];
if (!Children[backwardsIndex].Filtered.Value)
return Children[backwardsIndex];
if (!Items[forwardsIndex].Filtered.Value)
return Items[forwardsIndex];
if (!Items[backwardsIndex].Filtered.Value)
return Items[backwardsIndex];
// increment the indices
forwardsIndex++;