1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-30 05:59:53 +08:00

Add back scrollbar padding in new beatmap carousel

Closes https://github.com/ppy/osu/issues/33447. Implementation copied
from previous carousel.
This commit is contained in:
Dean Herbert
2025-06-11 16:33:59 +09:00
Unverified
parent 932ba3d590
commit cfd73cc900
2 changed files with 26 additions and 0 deletions
+23
View File
@@ -1009,6 +1009,29 @@ namespace osu.Game.Graphics.Carousel
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;
@@ -91,6 +91,9 @@ namespace osu.Game.Screens.SelectV2
DebounceDelay = 100;
DistanceOffscreenToPreload = 100;
// Account for the osu! logo being in the way.
Scroll.ScrollbarPaddingBottom = 70;
Filters = new ICarouselFilter[]
{
matching = new BeatmapCarouselFilterMatching(() => Criteria!),