diff --git a/osu.Game.Tests/Visual/Editing/TestSceneEditorClock.cs b/osu.Game.Tests/Visual/Editing/TestSceneEditorClock.cs index 54cc86bc6bda..bfc8af7283c1 100644 --- a/osu.Game.Tests/Visual/Editing/TestSceneEditorClock.cs +++ b/osu.Game.Tests/Visual/Editing/TestSceneEditorClock.cs @@ -104,6 +104,17 @@ public void TestClampWhenSeekOutsideBeatmapBounds() 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; + }); + } + [Test] public void TestAdjustmentsRemovedOnDisposal() { diff --git a/osu.Game/Screens/Edit/EditorClock.cs b/osu.Game/Screens/Edit/EditorClock.cs index d5ca6fc35e46..773abaa737ba 100644 --- a/osu.Game/Screens/Edit/EditorClock.cs +++ b/osu.Game/Screens/Edit/EditorClock.cs @@ -154,7 +154,7 @@ private void seek(int direction, bool snapped, double amount = 1) /// The current time of this clock, include any active transform seeks performed via . /// public double CurrentTimeAccurate => - Transforms.OfType().FirstOrDefault()?.EndValue ?? CurrentTime; + Transforms.OfType().LastOrDefault()?.EndValue ?? CurrentTime; public double CurrentTime => underlyingClock.CurrentTime;