mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 14:46:38 +09:00
Always use the local coordinate space
This commit is contained in:
@ -101,12 +101,12 @@ namespace osu.Game.Tests.Visual.Editor
|
||||
{
|
||||
createGrid();
|
||||
|
||||
Vector2 screenSpacePosition = Vector2.Zero;
|
||||
AddStep("get first tick position", () => screenSpacePosition = grid.ToScreenSpace(grid_position + new Vector2((float)beat_length, 0)));
|
||||
AddAssert("snap time is 1 beat away", () => Precision.AlmostEquals(beat_length, grid.GetSnapTime(screenSpacePosition), 0.01));
|
||||
Vector2 snapPosition = Vector2.Zero;
|
||||
AddStep("get first tick position", () => snapPosition = grid_position + new Vector2((float)beat_length, 0));
|
||||
AddAssert("snap time is 1 beat away", () => Precision.AlmostEquals(beat_length, grid.GetSnapTime(snapPosition), 0.01));
|
||||
|
||||
createGrid(g => g.Velocity = 2, "with velocity = 2");
|
||||
AddAssert("snap time is now 0.5 beats away", () => Precision.AlmostEquals(beat_length / 2, grid.GetSnapTime(screenSpacePosition), 0.01));
|
||||
AddAssert("snap time is now 0.5 beats away", () => Precision.AlmostEquals(beat_length / 2, grid.GetSnapTime(snapPosition), 0.01));
|
||||
}
|
||||
|
||||
private void createGrid(Action<TestBeatSnapGrid> func = null, string description = null)
|
||||
|
Reference in New Issue
Block a user