1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-28 04:03:06 +08:00

Merge pull request #12431 from peppy/fix-timeline-initial-seek

Fix timeline seeking to an incorrect initial location
This commit is contained in:
Dan Balasescu 2021-04-16 10:19:12 +09:00 committed by GitHub
commit a9d1d163bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -65,6 +65,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
this.userContent = userContent; this.userContent = userContent;
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
Height = timeline_height;
ZoomDuration = 200; ZoomDuration = 200;
ZoomEasing = Easing.OutQuint; ZoomEasing = Easing.OutQuint;
@ -127,7 +128,21 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
}); });
waveformOpacity = config.GetBindable<float>(OsuSetting.EditorWaveformOpacity); waveformOpacity = config.GetBindable<float>(OsuSetting.EditorWaveformOpacity);
Beatmap.BindTo(beatmap); Beatmap.BindTo(beatmap);
Beatmap.BindValueChanged(b =>
{
waveform.Waveform = b.NewValue.Waveform;
track = b.NewValue.Track;
// todo: i don't think this is safe, the track may not be loaded yet.
if (track.Length > 0)
{
MaxZoom = getZoomLevelForVisibleMilliseconds(500);
MinZoom = getZoomLevelForVisibleMilliseconds(10000);
Zoom = getZoomLevelForVisibleMilliseconds(2000);
}
}, true);
} }
protected override void LoadComplete() protected override void LoadComplete()
@ -157,20 +172,6 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
mainContent.Delay(180).MoveToY(0, 200, Easing.OutQuint); mainContent.Delay(180).MoveToY(0, 200, Easing.OutQuint);
} }
}, true); }, true);
Beatmap.BindValueChanged(b =>
{
waveform.Waveform = b.NewValue.Waveform;
track = b.NewValue.Track;
// todo: i don't think this is safe, the track may not be loaded yet.
if (track.Length > 0)
{
MaxZoom = getZoomLevelForVisibleMilliseconds(500);
MinZoom = getZoomLevelForVisibleMilliseconds(10000);
Zoom = getZoomLevelForVisibleMilliseconds(2000);
}
}, true);
} }
private void updateWaveformOpacity() => private void updateWaveformOpacity() =>