1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-21 12:57:20 +08:00

Ensure we always remain fully visible on any aspect ratio (including very tall ones).

This commit is contained in:
Dean Herbert 2016-09-30 18:46:34 +09:00
parent cc14aeb802
commit 0178e23b73

View File

@ -1,6 +1,7 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using osu.Framework.Graphics.Containers;
using OpenTK;
@ -13,7 +14,9 @@ namespace osu.Game.Graphics.Processing
protected override void Update()
{
base.Update();
Scale = new Vector2(Parent.ActualSize.Y / 768f);
Vector2 parent = Parent.ActualSize;
Scale = new Vector2(Math.Min(parent.Y / 768f, parent.X / 1024f));
Size = new Vector2(1 / Scale.X);
}
}