mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 10:07:52 +08:00
Fix blank space under tournament screen test scenes on very wide screens
This commit is contained in:
parent
09ee500f62
commit
e7c1664adb
@ -1,6 +1,7 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
@ -10,17 +11,28 @@ namespace osu.Game.Tournament.Tests
|
||||
{
|
||||
public abstract partial class TournamentScreenTestScene : TournamentTestScene
|
||||
{
|
||||
protected override Container<Drawable> Content { get; } = new DrawSizePreservingFillContainer
|
||||
{
|
||||
TargetDrawSize = new Vector2(1920, 1080),
|
||||
Scale = new Vector2(1920 / (float)(1920 + TournamentSceneManager.CONTROL_AREA_WIDTH)),
|
||||
RelativeSizeAxes = Axes.Both
|
||||
};
|
||||
protected override Container<Drawable> Content { get; } = new TournamentScalingContainer();
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
base.Content.Add(Content);
|
||||
}
|
||||
|
||||
private partial class TournamentScalingContainer : DrawSizePreservingFillContainer
|
||||
{
|
||||
public TournamentScalingContainer()
|
||||
{
|
||||
TargetDrawSize = new Vector2(1920, 1080);
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
|
||||
Scale = new Vector2(Math.Min(1, Content.DrawWidth / (1920 + TournamentSceneManager.CONTROL_AREA_WIDTH)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user