mirror of
https://github.com/ppy/osu.git
synced 2025-01-22 17:12:54 +08:00
Fix top rank display not showing up on beatmaps with many difficulties
This commit is contained in:
parent
f8ac54d61c
commit
e8b69581b7
@ -222,12 +222,6 @@ namespace osu.Game.Screens.Select
|
||||
InternalChild = new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Padding = new MarginPadding
|
||||
{
|
||||
// Avoid clash between scrollbar and osu! logo.
|
||||
Top = 10,
|
||||
Bottom = 100,
|
||||
},
|
||||
Children = new Drawable[]
|
||||
{
|
||||
setPool,
|
||||
@ -1271,6 +1265,38 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
return base.OnDragStart(e);
|
||||
}
|
||||
|
||||
protected override ScrollbarContainer CreateScrollbar(Direction direction)
|
||||
{
|
||||
return new PaddedScrollbar();
|
||||
}
|
||||
|
||||
protected partial class PaddedScrollbar : OsuScrollbar
|
||||
{
|
||||
public PaddedScrollbar()
|
||||
: base(Direction.Vertical)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private const float top_padding = 10;
|
||||
private const float bottom_padding = 80;
|
||||
|
||||
protected override float ToScrollbarPosition(float scrollPosition)
|
||||
{
|
||||
if (Precision.AlmostEquals(0, ScrollableExtent))
|
||||
return 0;
|
||||
|
||||
return top_padding + (ScrollbarMovementExtent - 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));
|
||||
}
|
||||
}
|
||||
|
||||
protected override void Dispose(bool isDisposing)
|
||||
|
Loading…
Reference in New Issue
Block a user