mirror of
https://github.com/ppy/osu.git
synced 2025-03-15 13:27:20 +08:00
Account for offset being applied to editor clock time in TestSceneEditorClock
This commit is contained in:
parent
90ff0864c0
commit
2dafa041a7
@ -63,7 +63,7 @@ namespace osu.Game.Tests.Visual.Editing
|
||||
AddStep("seek near end", () => EditorClock.Seek(EditorClock.TrackLength - 250));
|
||||
AddUntilStep("clock stops", () => !EditorClock.IsRunning);
|
||||
|
||||
AddUntilStep("clock stopped at end", () => EditorClock.CurrentTime, () => Is.EqualTo(EditorClock.TrackLength));
|
||||
AddUntilStep("clock stopped at end", () => EditorClock.CurrentTime - EditorClock.TotalAppliedOffset, () => Is.EqualTo(EditorClock.TrackLength));
|
||||
|
||||
AddStep("start clock again", () => EditorClock.Start());
|
||||
AddAssert("clock looped to start", () => EditorClock.IsRunning && EditorClock.CurrentTime < 500);
|
||||
|
@ -124,7 +124,7 @@ namespace osu.Game.Beatmaps
|
||||
finalClockSource.ProcessFrame();
|
||||
}
|
||||
|
||||
private double totalAppliedOffset
|
||||
public double TotalAppliedOffset
|
||||
{
|
||||
get
|
||||
{
|
||||
@ -169,7 +169,7 @@ namespace osu.Game.Beatmaps
|
||||
|
||||
public bool Seek(double position)
|
||||
{
|
||||
bool success = decoupledClock.Seek(position - totalAppliedOffset);
|
||||
bool success = decoupledClock.Seek(position - TotalAppliedOffset);
|
||||
finalClockSource.ProcessFrame();
|
||||
|
||||
return success;
|
||||
|
@ -158,6 +158,8 @@ namespace osu.Game.Screens.Edit
|
||||
|
||||
public double CurrentTime => underlyingClock.CurrentTime;
|
||||
|
||||
public double TotalAppliedOffset => underlyingClock.TotalAppliedOffset;
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
ClearTransforms();
|
||||
|
Loading…
x
Reference in New Issue
Block a user