1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 07:42:57 +08:00

Remove Size override from OsuPlayfield

This commit is contained in:
smoogipoo 2018-02-19 17:02:27 +09:00
parent 999d0f99a6
commit ef11ce3dd1
2 changed files with 7 additions and 16 deletions

View File

@ -27,21 +27,8 @@ namespace osu.Game.Rulesets.Osu.UI
public static readonly Vector2 BASE_SIZE = new Vector2(512, 384);
public override Vector2 Size
{
get
{
if (Parent == null)
return Vector2.Zero;
var parentSize = Parent.DrawSize;
var aspectSize = parentSize.X * 0.75f < parentSize.Y ? new Vector2(parentSize.X, parentSize.X * 0.75f) : new Vector2(parentSize.Y * 4f / 3f, parentSize.Y);
return new Vector2(aspectSize.X / parentSize.X, aspectSize.Y / parentSize.Y) * base.Size;
}
}
public OsuPlayfield() : base(BASE_SIZE.X)
public OsuPlayfield()
: base(BASE_SIZE.X)
{
Anchor = Anchor.Centre;
Origin = Anchor.Centre;

View File

@ -50,7 +50,11 @@ namespace osu.Game.Rulesets.Osu.UI
protected override FramedReplayInputHandler CreateReplayInputHandler(Replay replay) => new OsuReplayInputHandler(replay);
protected override Vector2 GetPlayfieldAspectAdjust() => new Vector2(0.75f);
protected override Vector2 GetPlayfieldAspectAdjust()
{
var aspectSize = DrawSize.X * 0.75f < DrawSize.Y ? new Vector2(DrawSize.X, DrawSize.X * 0.75f) : new Vector2(DrawSize.Y * 4f / 3f, DrawSize.Y);
return new Vector2(aspectSize.X / DrawSize.X, aspectSize.Y / DrawSize.Y) * 0.75f;
}
protected override CursorContainer CreateCursor() => new GameplayCursor();
}