Move ScreenSpacePositionAtTime to inside Column implementation

This commit is contained in:
Dean Herbert
2020-05-21 13:33:02 +09:00
parent 922b793a5a
commit 5ad7842b91
7 changed files with 18 additions and 28 deletions

View File

@ -140,5 +140,18 @@ namespace osu.Game.Rulesets.Mania.UI
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos)
// This probably shouldn't exist as is, but the columns in the stage are separated by a 1px border
=> DrawRectangle.Inflate(new Vector2(Stage.COLUMN_SPACING / 2, 0)).Contains(ToLocalSpace(screenSpacePos));
public Vector2 ScreenSpacePositionAtTime(double time, Column column = null)
{
var pos = ScrollingInfo.Algorithm.PositionAt(time, Time.Current, ScrollingInfo.TimeRange.Value, HitObjectContainer.DrawHeight);
if (ScrollingInfo.Direction.Value == ScrollingDirection.Down)
{
// as explained above
pos = HitObjectContainer.DrawHeight - pos;
}
return HitObjectContainer.ToScreenSpace(new Vector2(HitObjectContainer.DrawWidth / 2, pos));
}
}
}