Ensure `TestBeatmapCarousel.Items` only returns actually visible items (and in correct order)

Turns out that items could be in an order that isn't the same as how
things look on the carousel, so this change ensures that for testing
purposes they are sorted by Y position.

Also uses the `CarouselItem.Visible` flag to ensure that we don't have
to wait for drawable fade transitions after a filter operation.
This commit is contained in:
Dean Herbert 2023-03-03 17:18:33 +09:00
parent 7a092ea995
commit a14dede036
1 changed files with 4 additions and 1 deletions

View File

@ -1206,8 +1206,11 @@ public IEnumerable<DrawableCarouselItem> Items
{
get
{
foreach (var item in Scroll.Children)
foreach (var item in Scroll.Children.OrderBy(c => c.Y))
{
if (item.Item?.Visible != true)
continue;
yield return item;
if (item is DrawableCarouselBeatmapSet set)