From 87b8f8ef6e5f13a5c67204bf809f431572286561 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 5 Apr 2017 16:27:59 +0900 Subject: [PATCH] Fix incorrect relative mapping for CirclePiece's content. --- .../Objects/Drawables/Pieces/CirclePiece.cs | 14 +++++++++++--- .../Drawables/Pieces/ElongatedCirclePiece.cs | 11 ++++------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/osu.Game.Modes.Taiko/Objects/Drawables/Pieces/CirclePiece.cs b/osu.Game.Modes.Taiko/Objects/Drawables/Pieces/CirclePiece.cs index 76bc60d887..6ea1494ea7 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawables/Pieces/CirclePiece.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawables/Pieces/CirclePiece.cs @@ -26,7 +26,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawables.Pieces /// /// The amount to scale up the base circle to show it as a "strong" piece. /// - protected const float STRONG_SCALE = 1.5f; + private const float strong_scale = 1.5f; /// /// The colour of the inner circle and outer glows. @@ -125,13 +125,21 @@ namespace osu.Game.Modes.Taiko.Objects.Drawables.Pieces if (isStrong) { - Size *= STRONG_SCALE; + Size *= strong_scale; //default for symbols etc. - Content.Scale *= STRONG_SCALE; + Content.Scale *= strong_scale; } } + protected override void Update() + { + base.Update(); + + //we want to allow for width of content to remain mapped to the area inside us, regardless of the scale applied above. + Content.Width = 1 / Content.Scale.X; + } + private void resetEdgeEffects() { background.EdgeEffect = new EdgeEffect diff --git a/osu.Game.Modes.Taiko/Objects/Drawables/Pieces/ElongatedCirclePiece.cs b/osu.Game.Modes.Taiko/Objects/Drawables/Pieces/ElongatedCirclePiece.cs index d203c4ea05..5431507614 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawables/Pieces/ElongatedCirclePiece.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawables/Pieces/ElongatedCirclePiece.cs @@ -21,21 +21,18 @@ namespace osu.Game.Modes.Taiko.Objects.Drawables.Pieces public ElongatedCirclePiece(bool isStrong = false) : base(isStrong) { - if (isStrong) - { - //undo the strong scale provided in CirclePiece. - Content.Scale /= STRONG_SCALE; - } } protected override void Update() { base.Update(); + var padding = Content.DrawHeight * Content.Width / 2; + Content.Padding = new MarginPadding { - Left = DrawHeight / 2, - Right = DrawHeight / 2, + Left = padding, + Right = padding, }; Width = (PlayfieldLengthReference?.Invoke() ?? 0) * Length + DrawHeight;