From e3d10fc4d3681892b35bb40b6b37cf5062437582 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 6 Jun 2017 15:52:35 +0900 Subject: [PATCH] Update with more framework changes. --- osu-framework | 2 +- .../Tests/TestCaseManiaHitObjects.cs | 4 ++-- .../Objects/Drawables/DrawableHoldNote.cs | 2 +- .../Drawables/DrawableGravityTimingChange.cs | 4 ++-- .../Drawables/DrawableManiaTimingChange.cs | 2 +- .../Timing/Drawables/DrawableTimingChange.cs | 19 +++++-------------- 6 files changed, 12 insertions(+), 21 deletions(-) diff --git a/osu-framework b/osu-framework index 150c805604..00e48bcd31 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 150c80560480215b1081228b9ef757c21f24a32c +Subproject commit 00e48bcd31b7debda89bbcf62927706c43eba644 diff --git a/osu.Desktop.VisualTests/Tests/TestCaseManiaHitObjects.cs b/osu.Desktop.VisualTests/Tests/TestCaseManiaHitObjects.cs index a8a6a3f46d..010d8e7b48 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseManiaHitObjects.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseManiaHitObjects.cs @@ -41,7 +41,7 @@ namespace osu.Desktop.VisualTests.Tests { Name = "Timing section", RelativeSizeAxes = Axes.Both, - RelativeCoordinateSpace = new RectangleF(0, 0, 1, 10000), + RelativeChildSize = new Vector2(1, 10000), Children = new[] { new DrawableNote(new Note { StartTime = 5000 }) { AccentColour = Color4.Red }, @@ -63,7 +63,7 @@ namespace osu.Desktop.VisualTests.Tests { Name = "Timing section", RelativeSizeAxes = Axes.Both, - RelativeCoordinateSpace = new RectangleF(0, 0, 1, 10000), + RelativeChildSize = new Vector2(1, 10000), Children = new[] { new DrawableHoldNote(new HoldNote diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs index 53194a29f8..5830a1b8d9 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs @@ -56,7 +56,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables tickContainer = new Container { RelativeSizeAxes = Axes.Both, - RelativeCoordinateSpace = new RectangleF(0, 0, 1, (float)HitObject.Duration) + RelativeChildSize = new Vector2(1, (float)HitObject.Duration) }, head = new DrawableHeadNote(this, key) { diff --git a/osu.Game.Rulesets.Mania/Timing/Drawables/DrawableGravityTimingChange.cs b/osu.Game.Rulesets.Mania/Timing/Drawables/DrawableGravityTimingChange.cs index 39b78cee46..54b8bb35ae 100644 --- a/osu.Game.Rulesets.Mania/Timing/Drawables/DrawableGravityTimingChange.cs +++ b/osu.Game.Rulesets.Mania/Timing/Drawables/DrawableGravityTimingChange.cs @@ -19,7 +19,7 @@ namespace osu.Game.Rulesets.Mania.Timing.Drawables // The gravity-adjusted start position float startY = (float)computeGravityTime(TimingChange.Time); // The gravity-adjusted end position - float endY = (float)computeGravityTime(TimingChange.Time + Content.RelativeCoordinateSpace.Height); + float endY = (float)computeGravityTime(TimingChange.Time + Content.RelativeChildSize.Y); Content.Y = startY; Content.Height = endY - startY; @@ -43,7 +43,7 @@ namespace osu.Game.Rulesets.Mania.Timing.Drawables /// /// The time spanned by this container. /// - private double timeSpan => RelativeCoordinateSpace.Height; + private double timeSpan => RelativeChildSize.Y; /// /// The acceleration due to "gravity" of the content of this container. diff --git a/osu.Game.Rulesets.Mania/Timing/Drawables/DrawableManiaTimingChange.cs b/osu.Game.Rulesets.Mania/Timing/Drawables/DrawableManiaTimingChange.cs index ccf23f254c..9cbcca2b61 100644 --- a/osu.Game.Rulesets.Mania/Timing/Drawables/DrawableManiaTimingChange.cs +++ b/osu.Game.Rulesets.Mania/Timing/Drawables/DrawableManiaTimingChange.cs @@ -25,7 +25,7 @@ namespace osu.Game.Rulesets.Mania.Timing.Drawables // This is very naive and can be improved, but is adequate for now LifetimeStart = TimingChange.Time - parent.TimeSpan.Y; - LifetimeEnd = TimingChange.Time + Content.RelativeCoordinateSpace.Height * 2; + LifetimeEnd = TimingChange.Time + Content.RelativeChildSize.Y * 2; } } } \ No newline at end of file diff --git a/osu.Game/Rulesets/Timing/Drawables/DrawableTimingChange.cs b/osu.Game/Rulesets/Timing/Drawables/DrawableTimingChange.cs index 8c69c44235..d6b03be52f 100644 --- a/osu.Game/Rulesets/Timing/Drawables/DrawableTimingChange.cs +++ b/osu.Game/Rulesets/Timing/Drawables/DrawableTimingChange.cs @@ -43,7 +43,7 @@ namespace osu.Game.Rulesets.Timing.Drawables { RelativeSizeAxes = Axes.Both, RelativePositionAxes = Axes.Both, - RelativeCoordinateSpace = new RectangleF((scrollingAxes & Axes.X) > 0 ? (float)TimingChange.Time : 0, (scrollingAxes & Axes.Y) > 0 ? (float)TimingChange.Time : 0, 1, 1) + RelativeChildOffset = new Vector2((scrollingAxes & Axes.X) > 0 ? (float)TimingChange.Time : 0, (scrollingAxes & Axes.Y) > 0 ? (float)TimingChange.Time : 0) }); } @@ -64,7 +64,7 @@ namespace osu.Game.Rulesets.Timing.Drawables float speedAdjustedSize = (float)(1000 / TimingChange.BeatLength / TimingChange.SpeedMultiplier); Size = new Vector2((scrollingAxes & Axes.X) > 0 ? speedAdjustedSize : 1, (scrollingAxes & Axes.Y) > 0 ? speedAdjustedSize : 1); - RelativeCoordinateSpace = new RectangleF(0, 0, (scrollingAxes & Axes.X) > 0 ? parent.TimeSpan.X : 1, (scrollingAxes & Axes.Y) > 0 ? parent.TimeSpan.Y : 1); + RelativeChildSize = new Vector2((scrollingAxes & Axes.X) > 0 ? parent.TimeSpan.X : 1, (scrollingAxes & Axes.Y) > 0 ? parent.TimeSpan.Y : 1); } /// @@ -120,20 +120,11 @@ namespace osu.Game.Rulesets.Timing.Drawables if (!Children.Any()) return; - float width = Children.Select(child => child.X + child.Width).Max() - RelativePositionOffset.X; - float height = Children.Select(child => child.Y + child.Height).Max() - RelativePositionOffset.Y; + float width = Children.Select(child => child.X + child.Width).Max() - RelativeChildOffset.X; + float height = Children.Select(child => child.Y + child.Height).Max() - RelativeChildOffset.Y; Size = new Vector2((autoSizingAxes & Axes.X) > 0 ? width : Size.X, (autoSizingAxes & Axes.Y) > 0 ? height : Size.Y); - - var space = RelativeCoordinateSpace; - - if ((autoSizingAxes & Axes.X) > 0) - space.Width = width; - - if ((autoSizingAxes & Axes.Y) > 0) - space.Height = height; - - RelativeCoordinateSpace = space; + RelativeChildSize = new Vector2((autoSizingAxes & Axes.X) > 0 ? width : 1, (autoSizingAxes & Axes.Y) > 0 ? height : 1); }); } }