mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 09:32:55 +08:00
Merge pull request #26660 from EVAST9919/carousel-alloc
Reduce allocation overhead in `BeatmapCarousel`
This commit is contained in:
commit
62965549e7
@ -868,7 +868,7 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
var toDisplay = visibleItems.GetRange(displayedRange.first, displayedRange.last - displayedRange.first + 1);
|
||||
|
||||
foreach (var panel in Scroll.Children)
|
||||
foreach (var panel in Scroll)
|
||||
{
|
||||
Debug.Assert(panel.Item != null);
|
||||
|
||||
@ -899,7 +899,7 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
// Update externally controlled state of currently visible items (e.g. x-offset and opacity).
|
||||
// This is a per-frame update on all drawable panels.
|
||||
foreach (DrawableCarouselItem item in Scroll.Children)
|
||||
foreach (DrawableCarouselItem item in Scroll)
|
||||
{
|
||||
updateItem(item);
|
||||
|
||||
@ -1094,7 +1094,7 @@ namespace osu.Game.Screens.Select
|
||||
// to enter clamp-special-case mode where it animates completely differently to normal.
|
||||
float scrollChange = scrollTarget.Value - Scroll.Current;
|
||||
Scroll.ScrollTo(scrollTarget.Value, false);
|
||||
foreach (var i in Scroll.Children)
|
||||
foreach (var i in Scroll)
|
||||
i.Y += scrollChange;
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user