Skip to content

Commit

Permalink
Merge pull request ppy#31776 from frenzibyte/carousel-v2-depth-ordering
Browse files Browse the repository at this point in the history
Fix depth ordering in new carousel not being relative to selected item
  • Loading branch information
peppy authored Feb 4, 2025
2 parents 1793b8c + c587958 commit ec88c5e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions osu.Game/Screens/SelectV2/Carousel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -544,8 +544,8 @@ protected override void Update()
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);
Expand Down

0 comments on commit ec88c5e

Please sign in to comment.