mirror of
https://github.com/ppy/osu
synced 2024-12-15 19:36:34 +00: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);
|
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);
|
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).
|
// Update externally controlled state of currently visible items (e.g. x-offset and opacity).
|
||||||
// This is a per-frame update on all drawable panels.
|
// This is a per-frame update on all drawable panels.
|
||||||
foreach (DrawableCarouselItem item in Scroll.Children)
|
foreach (DrawableCarouselItem item in Scroll)
|
||||||
{
|
{
|
||||||
updateItem(item);
|
updateItem(item);
|
||||||
|
|
||||||
@ -1094,7 +1094,7 @@ namespace osu.Game.Screens.Select
|
|||||||
// to enter clamp-special-case mode where it animates completely differently to normal.
|
// to enter clamp-special-case mode where it animates completely differently to normal.
|
||||||
float scrollChange = scrollTarget.Value - Scroll.Current;
|
float scrollChange = scrollTarget.Value - Scroll.Current;
|
||||||
Scroll.ScrollTo(scrollTarget.Value, false);
|
Scroll.ScrollTo(scrollTarget.Value, false);
|
||||||
foreach (var i in Scroll.Children)
|
foreach (var i in Scroll)
|
||||||
i.Y += scrollChange;
|
i.Y += scrollChange;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user