osu/osu.Game/Graphics/Processing/RatioAdjust.cs

21 lines
588 B
C#
Raw Normal View History

2016-08-26 03:28:23 +00:00
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
2016-08-26 08:27:49 +00:00
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
2016-08-26 03:28:23 +00:00
using osu.Framework.Graphics.Containers;
using OpenTK;
namespace osu.Game.Graphics.Processing
{
class RatioAdjust : LargeContainer
{
public override bool Contains(Vector2 screenSpacePos) => true;
2016-08-26 03:28:23 +00:00
protected override void Update()
{
base.Update();
2016-09-10 17:23:26 +00:00
Scale = new Vector2(Parent.ActualSize.Y / 768f);
Size = new Vector2(1 / Scale.X);
2016-08-26 03:28:23 +00:00
}
}
}