1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-23 02:07:24 +08:00

Fix incorrect relative mapping for CirclePiece's content.

This commit is contained in:
Dean Herbert 2017-04-05 16:27:59 +09:00
parent 57a068c5d1
commit 87b8f8ef6e
No known key found for this signature in database
GPG Key ID: 46D71BF4958ABB49
2 changed files with 15 additions and 10 deletions

View File

@ -26,7 +26,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawables.Pieces
/// <summary>
/// The amount to scale up the base circle to show it as a "strong" piece.
/// </summary>
protected const float STRONG_SCALE = 1.5f;
private const float strong_scale = 1.5f;
/// <summary>
/// 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

View File

@ -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;