mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 07:33:55 +09:00
Merge branch 'master' into fix-triangles-performance
This commit is contained in:
@ -2,6 +2,7 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace osu.Game.Screens.Select.Carousel
|
||||
{
|
||||
@ -81,12 +82,10 @@ namespace osu.Game.Screens.Select.Carousel
|
||||
{
|
||||
base.Filter(criteria);
|
||||
|
||||
var children = new List<CarouselItem>(InternalChildren);
|
||||
|
||||
children.ForEach(c => c.Filter(criteria));
|
||||
children.Sort((x, y) => x.CompareTo(criteria, y));
|
||||
|
||||
InternalChildren = children;
|
||||
InternalChildren.ForEach(c => c.Filter(criteria));
|
||||
// IEnumerable<T>.OrderBy() is used instead of List<T>.Sort() to ensure sorting stability
|
||||
var criteriaComparer = Comparer<CarouselItem>.Create((x, y) => x.CompareTo(criteria, y));
|
||||
InternalChildren = InternalChildren.OrderBy(c => c, criteriaComparer).ToList();
|
||||
}
|
||||
|
||||
protected virtual void ChildItemStateChanged(CarouselItem item, CarouselItemState value)
|
||||
|
Reference in New Issue
Block a user