mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 00:23:59 +09:00
Move time clamp to Seek
/transformSeekTo
methods
This commit is contained in:
@ -118,7 +118,6 @@ namespace osu.Game.Screens.Edit
|
|||||||
|
|
||||||
if (!snapped || ControlPointInfo.TimingPoints.Count == 0)
|
if (!snapped || ControlPointInfo.TimingPoints.Count == 0)
|
||||||
{
|
{
|
||||||
seekTime = Math.Clamp(seekTime, 0, TrackLength);
|
|
||||||
SeekSmoothlyTo(seekTime);
|
SeekSmoothlyTo(seekTime);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -151,8 +150,6 @@ namespace osu.Game.Screens.Edit
|
|||||||
if (seekTime < timingPoint.Time && timingPoint != ControlPointInfo.TimingPoints.First())
|
if (seekTime < timingPoint.Time && timingPoint != ControlPointInfo.TimingPoints.First())
|
||||||
seekTime = timingPoint.Time;
|
seekTime = timingPoint.Time;
|
||||||
|
|
||||||
// Ensure the sought point is within the boundaries
|
|
||||||
seekTime = Math.Clamp(seekTime, 0, TrackLength);
|
|
||||||
SeekSmoothlyTo(seekTime);
|
SeekSmoothlyTo(seekTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -191,6 +188,9 @@ namespace osu.Game.Screens.Edit
|
|||||||
seekingOrStopped.Value = IsSeeking = true;
|
seekingOrStopped.Value = IsSeeking = true;
|
||||||
|
|
||||||
ClearTransforms();
|
ClearTransforms();
|
||||||
|
|
||||||
|
// Ensure the sought point is within the boundaries
|
||||||
|
position = Math.Clamp(position, 0, TrackLength);
|
||||||
return underlyingClock.Seek(position);
|
return underlyingClock.Seek(position);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -289,7 +289,7 @@ namespace osu.Game.Screens.Edit
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void transformSeekTo(double seek, double duration = 0, Easing easing = Easing.None)
|
private void transformSeekTo(double seek, double duration = 0, Easing easing = Easing.None)
|
||||||
=> this.TransformTo(this.PopulateTransform(new TransformSeek(), seek, duration, easing));
|
=> this.TransformTo(this.PopulateTransform(new TransformSeek(), Math.Clamp(seek, 0, TrackLength), duration, easing));
|
||||||
|
|
||||||
private double currentTime
|
private double currentTime
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user