mirror of
https://github.com/ppy/osu
synced 2025-02-07 13:51:59 +00:00
Merge pull request #8856 from peppy/fix-editor-hard-crash
Fix editor crashing when entering with no beatmap selected
This commit is contained in:
commit
2a1335a21e
@ -60,9 +60,12 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
waveform.Waveform = b.NewValue.Waveform;
|
waveform.Waveform = b.NewValue.Waveform;
|
||||||
track = b.NewValue.Track;
|
track = b.NewValue.Track;
|
||||||
|
|
||||||
MaxZoom = getZoomLevelForVisibleMilliseconds(500);
|
if (track.Length > 0)
|
||||||
MinZoom = getZoomLevelForVisibleMilliseconds(10000);
|
{
|
||||||
Zoom = getZoomLevelForVisibleMilliseconds(2000);
|
MaxZoom = getZoomLevelForVisibleMilliseconds(500);
|
||||||
|
MinZoom = getZoomLevelForVisibleMilliseconds(10000);
|
||||||
|
Zoom = getZoomLevelForVisibleMilliseconds(2000);
|
||||||
|
}
|
||||||
}, true);
|
}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -135,7 +138,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
|
|
||||||
private void scrollToTrackTime()
|
private void scrollToTrackTime()
|
||||||
{
|
{
|
||||||
if (!track.IsLoaded)
|
if (!track.IsLoaded || track.Length == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ScrollTo((float)(adjustableClock.CurrentTime / track.Length) * Content.DrawWidth, false);
|
ScrollTo((float)(adjustableClock.CurrentTime / track.Length) * Content.DrawWidth, false);
|
||||||
|
Loading…
Reference in New Issue
Block a user