File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed
Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -1009,6 +1009,29 @@ protected override void ApplyCurrentToContent()
10091009 d . Y = ( float ) ( ( ( ICarouselPanel ) d ) . DrawYPosition + scrollableExtent ) ;
10101010 }
10111011
1012+ #region Scrollbar padding
1013+
1014+ public float ScrollbarPaddingTop { get ; set ; } = 5 ;
1015+ public float ScrollbarPaddingBottom { get ; set ; } = 5 ;
1016+
1017+ protected override float ToScrollbarPosition ( double scrollPosition )
1018+ {
1019+ if ( Precision . AlmostEquals ( 0 , ScrollableExtent ) )
1020+ return 0 ;
1021+
1022+ return ( float ) ( ScrollbarPaddingTop + ( ScrollbarMovementExtent - ( ScrollbarPaddingTop + ScrollbarPaddingBottom ) ) * ( scrollPosition / ScrollableExtent ) ) ;
1023+ }
1024+
1025+ protected override float FromScrollbarPosition ( float scrollbarPosition )
1026+ {
1027+ if ( Precision . AlmostEquals ( 0 , ScrollbarMovementExtent ) )
1028+ return 0 ;
1029+
1030+ return ( float ) ( ScrollableExtent * ( ( scrollbarPosition - ScrollbarPaddingTop ) / ( ScrollbarMovementExtent - ( ScrollbarPaddingTop + ScrollbarPaddingBottom ) ) ) ) ;
1031+ }
1032+
1033+ #endregion
1034+
10121035 #region Absolute scrolling
10131036
10141037 private bool absoluteScrolling ;
Original file line number Diff line number Diff line change @@ -91,6 +91,9 @@ public BeatmapCarousel()
9191 DebounceDelay = 100 ;
9292 DistanceOffscreenToPreload = 100 ;
9393
94+ // Account for the osu! logo being in the way.
95+ Scroll . ScrollbarPaddingBottom = 70 ;
96+
9497 Filters = new ICarouselFilter [ ]
9598 {
9699 matching = new BeatmapCarouselFilterMatching ( ( ) => Criteria ! ) ,
You can’t perform that action at this time.
0 commit comments