Simplify drawable removal logic

This commit is contained in:
Dean Herbert 2017-12-18 12:05:49 +09:00
parent b2cd32eb95
commit 23e014b52d
1 changed files with 1 additions and 6 deletions

View File

@ -475,12 +475,7 @@ protected override void Update()
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);