Skip to content
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
23 changes: 23 additions & 0 deletions osu.Game/Graphics/Carousel/Carousel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1009,6 +1009,29 @@ protected override void ApplyCurrentToContent()
d.Y = (float)(((ICarouselPanel)d).DrawYPosition + scrollableExtent);
}

#region Scrollbar padding

public float ScrollbarPaddingTop { get; set; } = 5;
public float ScrollbarPaddingBottom { get; set; } = 5;

protected override float ToScrollbarPosition(double scrollPosition)
{
if (Precision.AlmostEquals(0, ScrollableExtent))
return 0;

return (float)(ScrollbarPaddingTop + (ScrollbarMovementExtent - (ScrollbarPaddingTop + ScrollbarPaddingBottom)) * (scrollPosition / ScrollableExtent));
}

protected override float FromScrollbarPosition(float scrollbarPosition)
{
if (Precision.AlmostEquals(0, ScrollbarMovementExtent))
return 0;

return (float)(ScrollableExtent * ((scrollbarPosition - ScrollbarPaddingTop) / (ScrollbarMovementExtent - (ScrollbarPaddingTop + ScrollbarPaddingBottom))));
}

#endregion

#region Absolute scrolling

private bool absoluteScrolling;
Expand Down
3 changes: 3 additions & 0 deletions osu.Game/Screens/SelectV2/BeatmapCarousel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ public BeatmapCarousel()
DebounceDelay = 100;
DistanceOffscreenToPreload = 100;

// Account for the osu! logo being in the way.
Scroll.ScrollbarPaddingBottom = 70;

Filters = new ICarouselFilter[]
{
matching = new BeatmapCarouselFilterMatching(() => Criteria!),
Expand Down