Merge pull request #10521 from peppy/fix-editor-seek-interval-when-playing

Fix editor not seeking by full beat when track is playing
This commit is contained in:
Dan Balasescu 2020-10-16 13:55:03 +09:00 committed by GitHub
commit 829241a9f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -597,10 +597,20 @@ namespace osu.Game.Screens.Edit
{
double amount = e.ShiftPressed ? 4 : 1;
bool trackPlaying = clock.IsRunning;
if (trackPlaying)
{
// generally users are not looking to perform tiny seeks when the track is playing,
// so seeks should always be by one full beat, bypassing the beatDivisor.
// this multiplication undoes the division that will be applied in the underlying seek operation.
amount *= beatDivisor.Value;
}
if (direction < 1)
clock.SeekBackward(!clock.IsRunning, amount);
clock.SeekBackward(!trackPlaying, amount);
else
clock.SeekForward(!clock.IsRunning, amount);
clock.SeekForward(!trackPlaying, amount);
}
private void exportBeatmap()