mirror of
https://github.com/ppy/osu
synced 2025-01-11 16:49:39 +00:00
Merge pull request #28772 from OliBomby/time-accurate
Fix CurrentTimeAccurate being inaccurate
This commit is contained in:
commit
baff790b4c
@ -104,6 +104,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;
|
||||
});
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestAdjustmentsRemovedOnDisposal()
|
||||
{
|
||||
|
@ -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