mirror of
https://github.com/ppy/osu
synced 2025-02-22 05:27:05 +00:00
Adjust beatmap carousel's spacing to remove dead-space
As discussed in https://github.com/ppy/osu/discussions/28599. I think this feels better overall, and would like to apply the change before other design changes to the carousel.
This commit is contained in:
parent
9039ec34ba
commit
5d4509150b
@ -1000,8 +1000,6 @@ namespace osu.Game.Screens.Select
|
||||
return set;
|
||||
}
|
||||
|
||||
private const float panel_padding = 5;
|
||||
|
||||
/// <summary>
|
||||
/// Computes the target Y positions for every item in the carousel.
|
||||
/// </summary>
|
||||
@ -1023,10 +1021,18 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
case CarouselBeatmapSet set:
|
||||
{
|
||||
bool isSelected = item.State.Value == CarouselItemState.Selected;
|
||||
|
||||
float padding = isSelected ? 5 : -5;
|
||||
|
||||
if (isSelected)
|
||||
// double padding because we want to cancel the negative padding from the last item.
|
||||
currentY += padding * 2;
|
||||
|
||||
visibleItems.Add(set);
|
||||
set.CarouselYPosition = currentY;
|
||||
|
||||
if (item.State.Value == CarouselItemState.Selected)
|
||||
if (isSelected)
|
||||
{
|
||||
// scroll position at currentY makes the set panel appear at the very top of the carousel's screen space
|
||||
// move down by half of visible height (height of the carousel's visible extent, including semi-transparent areas)
|
||||
@ -1048,7 +1054,7 @@ namespace osu.Game.Screens.Select
|
||||
}
|
||||
}
|
||||
|
||||
currentY += set.TotalHeight + panel_padding;
|
||||
currentY += set.TotalHeight + padding;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user