diff --git a/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonManiaComboCounter.cs b/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonManiaComboCounter.cs index 5b23cea49623..6626e5f1c768 100644 --- a/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonManiaComboCounter.cs +++ b/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonManiaComboCounter.cs @@ -38,11 +38,11 @@ protected override void LoadComplete() private void updateAnchor() { // if the anchor isn't a vertical center, set top or bottom anchor based on scroll direction - if (!Anchor.HasFlag(Anchor.y1)) - { - Anchor &= ~(Anchor.y0 | Anchor.y2); - Anchor |= direction.Value == ScrollingDirection.Up ? Anchor.y2 : Anchor.y0; - } + if (Anchor.HasFlag(Anchor.y1)) + return; + + Anchor &= ~(Anchor.y0 | Anchor.y2); + Anchor |= direction.Value == ScrollingDirection.Up ? Anchor.y2 : Anchor.y0; // change the sign of the Y coordinate in line with the scrolling direction. // i.e. if the user changes direction from down to up, the anchor is changed from top to bottom, and the Y is flipped from positive to negative here. diff --git a/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyManiaComboCounter.cs b/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyManiaComboCounter.cs index 5832210836df..07d014b416fe 100644 --- a/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyManiaComboCounter.cs +++ b/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyManiaComboCounter.cs @@ -1,6 +1,7 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System; using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Graphics; @@ -44,16 +45,15 @@ protected override void LoadComplete() private void updateAnchor() { // if the anchor isn't a vertical center, set top or bottom anchor based on scroll direction - if (!Anchor.HasFlag(Anchor.y1)) - { - Anchor &= ~(Anchor.y0 | Anchor.y2); - Anchor |= direction.Value == ScrollingDirection.Up ? Anchor.y2 : Anchor.y0; - } + if (Anchor.HasFlag(Anchor.y1)) + return; + + Anchor &= ~(Anchor.y0 | Anchor.y2); + Anchor |= direction.Value == ScrollingDirection.Up ? Anchor.y2 : Anchor.y0; - // since we flip the vertical anchor when changing scroll direction, - // we can use the sign of the Y value as an indicator to make the combo counter displayed correctly. - if ((Y < 0 && direction.Value == ScrollingDirection.Down) || (Y > 0 && direction.Value == ScrollingDirection.Up)) - Y = -Y; + // change the sign of the Y coordinate in line with the scrolling direction. + // i.e. if the user changes direction from down to up, the anchor is changed from top to bottom, and the Y is flipped from positive to negative here. + Y = Math.Abs(Y) * (direction.Value == ScrollingDirection.Up ? -1 : 1); } protected override void OnCountIncrement()