1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 09:42:54 +08:00

Simplify drawable removal logic

This commit is contained in:
Dean Herbert 2017-12-18 12:05:49 +09:00
parent b2cd32eb95
commit 23e014b52d

View File

@ -475,12 +475,7 @@ namespace osu.Game.Screens.Select
float drawHeight = DrawHeight; float drawHeight = DrawHeight;
// Remove all items that should no longer be on-screen // Remove all items that should no longer be on-screen
scrollableContent.RemoveAll(delegate (DrawableCarouselItem p) scrollableContent.RemoveAll(p => p.Y < Current - p.DrawHeight || p.Y > Current + drawHeight || !p.IsPresent);
{
float itemPosY = p.Position.Y;
bool remove = itemPosY < Current - p.DrawHeight || itemPosY > Current + drawHeight || !p.IsPresent;
return remove;
});
// Find index range of all items that should be on-screen // Find index range of all items that should be on-screen
Trace.Assert(Items.Count == yPositions.Count); Trace.Assert(Items.Count == yPositions.Count);