mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 19:22:54 +08:00
Simplify drawable removal logic
This commit is contained in:
parent
b2cd32eb95
commit
23e014b52d
@ -475,12 +475,7 @@ namespace osu.Game.Screens.Select
|
||||
float drawHeight = DrawHeight;
|
||||
|
||||
// Remove all items that should no longer be on-screen
|
||||
scrollableContent.RemoveAll(delegate (DrawableCarouselItem p)
|
||||
{
|
||||
float itemPosY = p.Position.Y;
|
||||
bool remove = itemPosY < Current - p.DrawHeight || itemPosY > Current + drawHeight || !p.IsPresent;
|
||||
return remove;
|
||||
});
|
||||
scrollableContent.RemoveAll(p => p.Y < Current - p.DrawHeight || p.Y > Current + drawHeight || !p.IsPresent);
|
||||
|
||||
// Find index range of all items that should be on-screen
|
||||
Trace.Assert(Items.Count == yPositions.Count);
|
||||
|
Loading…
Reference in New Issue
Block a user