From 9d2a46df892587185343b8ebb7723823df750c33 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 22 Jan 2020 21:46:24 +0900 Subject: [PATCH] Add beat snapping to timeline movement --- .../Screens/Edit/Compose/Components/Timeline/Timeline.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Edit/Compose/Components/Timeline/Timeline.cs b/osu.Game/Screens/Edit/Compose/Components/Timeline/Timeline.cs index 21eb4b08b0..98fb754931 100644 --- a/osu.Game/Screens/Edit/Compose/Components/Timeline/Timeline.cs +++ b/osu.Game/Screens/Edit/Compose/Components/Timeline/Timeline.cs @@ -173,7 +173,11 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline [Resolved] 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) {