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

Merge pull request #28615 from peppy/adjust-depth-carousel

Ensure carousel panel depth is consistent based on vertical position
This commit is contained in:
Bartłomiej Dach 2024-06-26 14:58:25 +02:00 committed by GitHub
commit dd4c0038c6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -895,7 +895,6 @@ namespace osu.Game.Screens.Select
{
var panel = setPool.Get(p => p.Item = item);
panel.Depth = item.CarouselYPosition;
panel.Y = item.CarouselYPosition;
Scroll.Add(panel);
@ -915,6 +914,8 @@ namespace osu.Game.Screens.Select
{
bool isSelected = item.Item.State.Value == CarouselItemState.Selected;
bool hasPassedSelection = item.Item.CarouselYPosition < selectedBeatmapSet?.CarouselYPosition;
// Cheap way of doing animations when entering / exiting song select.
const double half_time = 50;
const float panel_x_offset_when_inactive = 200;
@ -929,6 +930,8 @@ namespace osu.Game.Screens.Select
item.Alpha = (float)Interpolation.DampContinuously(item.Alpha, 0, half_time, Clock.ElapsedFrameTime);
item.X = (float)Interpolation.DampContinuously(item.X, panel_x_offset_when_inactive, half_time, Clock.ElapsedFrameTime);
}
Scroll.ChangeChildDepth(item, hasPassedSelection ? -item.Item.CarouselYPosition : item.Item.CarouselYPosition);
}
if (item is DrawableCarouselBeatmapSet set)