Fix incorrect anchor handling in `ArgonManiaComboCounter`

This commit is contained in:
Dean Herbert 2024-08-14 15:12:23 +09:00
parent e465049050
commit 7c142bcedf
No known key found for this signature in database
1 changed files with 6 additions and 2 deletions

View File

@ -30,8 +30,12 @@ protected override void LoadComplete()
private void updateAnchor() private void updateAnchor()
{ {
Anchor &= ~(Anchor.y0 | Anchor.y2); // if the anchor isn't a vertical center, set top or bottom anchor based on scroll direction
Anchor |= direction.Value == ScrollingDirection.Up ? Anchor.y2 : Anchor.y0; if (!Anchor.HasFlag(Anchor.y1))
{
Anchor &= ~(Anchor.y0 | Anchor.y2);
Anchor |= direction.Value == ScrollingDirection.Up ? Anchor.y2 : Anchor.y0;
}
// since we flip the vertical anchor when changing scroll direction, // 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. // we can use the sign of the Y value as an indicator to make the combo counter displayed correctly.