From 0c90ef79fa7e710253a48bae685ed5480c5fca47 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Wed, 12 Apr 2017 12:36:31 +0900 Subject: [PATCH] Make TestCaseTaikoPlayfield work again. --- .../Tests/TestCaseTaikoPlayfield.cs | 14 +++++++++----- osu.Game/Modes/UI/Playfield.cs | 3 +++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs b/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs index a8e4382ebb..e886af6b83 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs @@ -27,6 +27,7 @@ namespace osu.Desktop.VisualTests.Tests private readonly Random rng = new Random(1337); private TaikoPlayfield playfield; + private Container playfieldContainer; public override void Reset() { @@ -51,11 +52,14 @@ namespace osu.Desktop.VisualTests.Tests var rateAdjustClock = new StopwatchClock(true) { Rate = 1 }; - Add(new Container + Add(playfieldContainer = new Container { - Clock = new FramedClock(rateAdjustClock), + Anchor = Anchor.Centre, + Origin = Anchor.Centre, RelativeSizeAxes = Axes.X, - Y = 200, + Height = TaikoPlayfield.DEFAULT_PLAYFIELD_HEIGHT, + Width = 0.8f, + Clock = new FramedClock(rateAdjustClock), Children = new[] { playfield = new TaikoPlayfield() @@ -81,11 +85,11 @@ namespace osu.Desktop.VisualTests.Tests break; case 5: addSwell(1000); - playfield.Delay(scroll_time - 100); + playfieldContainer.Delay(scroll_time - 100); break; } - playfield.ResizeTo(new Vector2(1, rng.Next(25, 400)), 500); + playfieldContainer.ResizeTo(new Vector2(1, rng.Next(25, 400)), 500); } private void addHitJudgement() diff --git a/osu.Game/Modes/UI/Playfield.cs b/osu.Game/Modes/UI/Playfield.cs index bf5f0acde5..e8e53ab1f0 100644 --- a/osu.Game/Modes/UI/Playfield.cs +++ b/osu.Game/Modes/UI/Playfield.cs @@ -38,6 +38,9 @@ namespace osu.Game.Modes.UI protected Playfield(float? customWidth = null) { AlwaysReceiveInput = true; + + // Default height since we force RelativeSizeAxes = Both + Size = Vector2.One; AddInternal(ScaledContent = new ScaledContainer {