mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 10:02:59 +08:00
Add beat snapping to timeline movement
This commit is contained in:
parent
c76f76e5aa
commit
9d2a46df89
@ -173,7 +173,11 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private EditorBeatmap beatmap { get; set; }
|
private EditorBeatmap beatmap { get; set; }
|
||||||
|
|
||||||
public (Vector2 position, double time) GetSnappedPosition(Vector2 position, double time) => (position, (position.X / Content.DrawWidth) * track.Length);
|
public (Vector2 position, double time) GetSnappedPosition(Vector2 position, double time)
|
||||||
|
{
|
||||||
|
var targetTime = (position.X / Content.DrawWidth) * track.Length;
|
||||||
|
return (position, beatSnap(targetTime, targetTime));
|
||||||
|
}
|
||||||
|
|
||||||
public float GetBeatSnapDistanceAt(double referenceTime)
|
public float GetBeatSnapDistanceAt(double referenceTime)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user