Skip to content

Commit

Permalink
Make math more logical
Browse files Browse the repository at this point in the history
  • Loading branch information
peppy committed Nov 11, 2024
1 parent ee4d585 commit 8c5785f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions osu.Game/Screens/Select/BeatmapCarousel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1280,22 +1280,22 @@ public PaddedScrollbar()
}

private const float top_padding = 10;
private const float bottom_padding = 80;
private const float bottom_padding = 70;

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

return top_padding + (ScrollbarMovementExtent - bottom_padding) * (scrollPosition / ScrollableExtent);
return top_padding + (ScrollbarMovementExtent - (top_padding + bottom_padding)) * (scrollPosition / ScrollableExtent);
}

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

return ScrollableExtent * ((scrollbarPosition - top_padding) / (ScrollbarMovementExtent - bottom_padding));
return ScrollableExtent * ((scrollbarPosition - top_padding) / (ScrollbarMovementExtent - (top_padding + bottom_padding)));
}
}

Expand Down

0 comments on commit 8c5785f

Please sign in to comment.