Fix note placement offset not working for down-scroll

This commit is contained in:
smoogipoo 2019-10-03 18:21:50 +09:00
parent 754fbc59e1
commit 0a409075be
1 changed files with 17 additions and 2 deletions

View File

@ -111,8 +111,23 @@ protected Column ColumnAt(Vector2 screenSpacePosition)
private Vector2 applyPositionOffset(Vector2 position, bool reverse)
{
position.Y += (scrollingInfo.Direction.Value == ScrollingDirection.Up && !reverse ? -1 : 1) * NotePiece.NOTE_HEIGHT / 2;
return position;
float offset = 0;
switch (scrollingInfo.Direction.Value)
{
case ScrollingDirection.Up:
offset = -NotePiece.NOTE_HEIGHT / 2;
break;
case ScrollingDirection.Down:
offset = NotePiece.NOTE_HEIGHT / 2;
break;
}
if (reverse)
offset = -offset;
return new Vector2(position.X, position.Y + offset);
}
}
}