mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Implement slider path distance snapping
This commit is contained in:
@ -128,6 +128,13 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
/// <returns>The time at the snapped position.</returns>
|
||||
public double GetSnapTime(Vector2 position) => startTime + (position - CentrePosition).Length / Velocity;
|
||||
|
||||
/// <summary>
|
||||
/// Snaps a distance by the snap distance of this grid.
|
||||
/// </summary>
|
||||
/// <param name="distance">The distance to snap.</param>
|
||||
/// <returns>The snapped distance.</returns>
|
||||
public float GetSnapDistance(float distance) => (int)(distance / DistanceSpacing) * DistanceSpacing;
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the applicable colour for a beat index.
|
||||
/// </summary>
|
||||
|
Reference in New Issue
Block a user