mirror of
https://github.com/osukey/osukey.git
synced 2025-05-19 20:47:24 +09:00
Use expiry to avoid ToArray
This commit is contained in:
parent
075bf23714
commit
1b7e3397c6
@ -595,7 +595,7 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
var toDisplay = visibleItems.GetRange(displayedRange.first, displayedRange.last - displayedRange.first);
|
var toDisplay = visibleItems.GetRange(displayedRange.first, displayedRange.last - displayedRange.first);
|
||||||
|
|
||||||
foreach (var panel in scrollableContent.Children.ToArray())
|
foreach (var panel in scrollableContent.Children)
|
||||||
{
|
{
|
||||||
if (toDisplay.Remove(panel.Item))
|
if (toDisplay.Remove(panel.Item))
|
||||||
{
|
{
|
||||||
@ -606,7 +606,11 @@ namespace osu.Game.Screens.Select
|
|||||||
// panel loaded as drawable but not required by visible range.
|
// panel loaded as drawable but not required by visible range.
|
||||||
// remove but only if too far off-screen
|
// remove but only if too far off-screen
|
||||||
if (panel.Y < visibleUpperBound - distance_offscreen_before_unload || panel.Y > visibleBottomBound + distance_offscreen_before_unload)
|
if (panel.Y < visibleUpperBound - distance_offscreen_before_unload || panel.Y > visibleBottomBound + distance_offscreen_before_unload)
|
||||||
scrollableContent.Remove(panel);
|
{
|
||||||
|
// todo: may want a fade effect here (could be seen if a huge change happens, like a set with 20 difficulties becomes selected).
|
||||||
|
panel.ClearTransforms();
|
||||||
|
panel.Expire();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add those items within the previously found index range that should be displayed.
|
// Add those items within the previously found index range that should be displayed.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user