Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust beatmap carousel's spacing to remove dead-space #28601

Merged
merged 2 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions osu.Game/Screens/Select/BeatmapCarousel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1000,8 +1000,6 @@ private static void expirePanelImmediately(DrawableCarouselItem panel)
return set;
}

private const float panel_padding = 5;

/// <summary>
/// Computes the target Y positions for every item in the carousel.
/// </summary>
Expand All @@ -1023,10 +1021,18 @@ private void updateYPositions()
{
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)
Expand All @@ -1048,7 +1054,7 @@ private void updateYPositions()
}
}

currentY += set.TotalHeight + panel_padding;
currentY += set.TotalHeight + padding;
break;
}
}
Expand Down
4 changes: 2 additions & 2 deletions osu.Game/Screens/Select/Carousel/DrawableCarouselItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ protected virtual void ApplyState()
}

if (!Item.Visible)
this.FadeOut(300, Easing.OutQuint);
this.FadeOut(100, Easing.OutQuint);
else
this.FadeIn(250);
this.FadeIn(400, Easing.OutQuint);
}

protected virtual void Selected()
Expand Down
Loading