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:
parent
b2cd32eb95
commit
23e014b52d
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user