mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 21:02:54 +08:00
Fix CurrentTimeAccurate being inaccurate if seeking smoothly in the same frame and a transform is already active
This commit is contained in:
parent
c0a1696538
commit
2822ba2377
@ -102,6 +102,17 @@ namespace osu.Game.Tests.Visual.Editing
|
||||
AddUntilStep("time is clamped to track length", () => EditorClock.CurrentTime, () => Is.EqualTo(EditorClock.TrackLength));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCurrentTimeDoubleTransform()
|
||||
{
|
||||
AddAssert("seek smoothly twice and current time is accurate", () =>
|
||||
{
|
||||
EditorClock.SeekSmoothlyTo(1000);
|
||||
EditorClock.SeekSmoothlyTo(2000);
|
||||
return 2000 == EditorClock.CurrentTimeAccurate;
|
||||
});
|
||||
}
|
||||
|
||||
protected override void Dispose(bool isDisposing)
|
||||
{
|
||||
Beatmap.Disabled = false;
|
||||
|
@ -154,7 +154,7 @@ namespace osu.Game.Screens.Edit
|
||||
/// The current time of this clock, include any active transform seeks performed via <see cref="SeekSmoothlyTo"/>.
|
||||
/// </summary>
|
||||
public double CurrentTimeAccurate =>
|
||||
Transforms.OfType<TransformSeek>().FirstOrDefault()?.EndValue ?? CurrentTime;
|
||||
Transforms.OfType<TransformSeek>().LastOrDefault()?.EndValue ?? CurrentTime;
|
||||
|
||||
public double CurrentTime => underlyingClock.CurrentTime;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user