mirror of
https://github.com/ppy/osu.git
synced 2025-03-06 03:03:05 +08:00
Reuse function TimeAtPosition()
and PositionAtTime()
.
This commit is contained in:
parent
933d1d549b
commit
a753369d3e
@ -250,7 +250,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
|
|
||||||
private void seekTrackToCurrent()
|
private void seekTrackToCurrent()
|
||||||
{
|
{
|
||||||
double target = Current / Content.DrawWidth * editorClock.TrackLength;
|
double target = TimeAtPosition(Current);
|
||||||
editorClock.Seek(Math.Min(editorClock.TrackLength, target));
|
editorClock.Seek(Math.Min(editorClock.TrackLength, target));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -264,7 +264,8 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
if (handlingDragInput)
|
if (handlingDragInput)
|
||||||
editorClock.Stop();
|
editorClock.Stop();
|
||||||
|
|
||||||
ScrollTo((float)(editorClock.CurrentTime / editorClock.TrackLength) * Content.DrawWidth, false);
|
float position = PositionAtTime(editorClock.CurrentTime);
|
||||||
|
ScrollTo(position, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnMouseDown(MouseDownEvent e)
|
protected override bool OnMouseDown(MouseDownEvent e)
|
||||||
|
Loading…
Reference in New Issue
Block a user