Fix scroll container height on smaller ui scales

This commit is contained in:
smoogipoo 2020-06-30 16:36:53 +09:00
parent 50ae69b111
commit 1701c844a6

View File

@ -70,19 +70,13 @@ namespace osu.Game.Screens.Ranking
{ {
new Drawable[] new Drawable[]
{ {
new Container new VerticalScrollContainer
{
RelativeSizeAxes = Axes.Both,
Children = new Drawable[]
{
new OsuScrollContainer
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
ScrollbarVisible = false, ScrollbarVisible = false,
Child = new Container Child = new Container
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.Both,
Height = screen_height,
Children = new Drawable[] Children = new Drawable[]
{ {
scorePanelList = new ScorePanelList scorePanelList = new ScorePanelList
@ -103,8 +97,6 @@ namespace osu.Game.Screens.Ranking
} }
} }
}, },
}
}
}, },
new[] new[]
{ {
@ -277,5 +269,23 @@ namespace osu.Game.Screens.Ranking
detachedPanel = null; detachedPanel = null;
} }
} }
private class VerticalScrollContainer : OsuScrollContainer
{
protected override Container<Drawable> Content => content;
private readonly Container content;
public VerticalScrollContainer()
{
base.Content.Add(content = new Container { RelativeSizeAxes = Axes.X });
}
protected override void Update()
{
base.Update();
content.Height = Math.Max(screen_height, DrawHeight);
}
}
} }
} }