1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-11 07:57:18 +08:00

Merge pull request #31776 from frenzibyte/carousel-v2-depth-ordering

Fix depth ordering in new carousel not being relative to selected item
This commit is contained in:
Dean Herbert 2025-02-04 13:02:21 +09:00 committed by GitHub
commit ec88c5ed75
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -544,8 +544,8 @@ namespace osu.Game.Screens.SelectV2
if (c.Item == null)
continue;
if (panel.Depth != c.DrawYPosition)
scroll.Panels.ChangeChildDepth(panel, (float)c.DrawYPosition);
double selectedYPos = currentSelection?.CarouselItem?.CarouselYPosition ?? 0;
scroll.Panels.ChangeChildDepth(panel, (float)Math.Abs(c.DrawYPosition - selectedYPos));
if (c.DrawYPosition != c.Item.CarouselYPosition)
c.DrawYPosition = Interpolation.DampContinuously(c.DrawYPosition, c.Item.CarouselYPosition, 50, Time.Elapsed);