mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 09:07:52 +08:00
Prevent snapping outside of track length
This commit is contained in:
parent
0ffefce2a7
commit
15c56fcf8f
@ -317,6 +317,8 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
||||
public SnapResult FindSnappedPositionAndTime(Vector2 screenSpacePosition, SnapType snapType = SnapType.All)
|
||||
{
|
||||
double time = TimeAtPosition(Content.ToLocalSpace(screenSpacePosition).X);
|
||||
// prevent snapping outside of track length
|
||||
time = Math.Min(time, editorClock.TrackLength);
|
||||
return new SnapResult(screenSpacePosition, beatSnapProvider.SnapTime(time));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user