mirror of
https://github.com/ppy/osu
synced 2025-01-09 23:59:44 +00:00
Fix incorrect relative mapping for CirclePiece's content.
This commit is contained in:
parent
57a068c5d1
commit
87b8f8ef6e
@ -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
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user