mirror of
https://github.com/ppy/osu.git
synced 2024-11-15 17:17:26 +08:00
540c58c359
This would cause things to look completely out of whack. The numbers here match `DrawSizePreservingFillContainer` defaults as used by `OsuGameBase.CreateScalingContainer()`.
39 lines
1.1 KiB
C#
39 lines
1.1 KiB
C#
// 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;
|
|
using osuTK;
|
|
|
|
namespace osu.Game.Tournament.Tests
|
|
{
|
|
public abstract partial class TournamentScreenTestScene : TournamentTestScene
|
|
{
|
|
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(1024, 768);
|
|
RelativeSizeAxes = Axes.Both;
|
|
}
|
|
|
|
protected override void Update()
|
|
{
|
|
base.Update();
|
|
|
|
Scale = new Vector2(Math.Min(1, Content.DrawWidth / (1920 + TournamentSceneManager.CONTROL_AREA_WIDTH)));
|
|
}
|
|
}
|
|
}
|
|
}
|