Fix test case not working as expected

This commit is contained in:
Dean Herbert 2017-09-27 12:46:34 +08:00
parent faad3fc7d3
commit e64860ad45

View File

@ -32,22 +32,15 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts
private void updateRelativeChildSize()
{
if (!Beatmap.Value.TrackLoaded)
// the track may not be loaded completely (only has a length once it is).
if (!Beatmap.Value.Track.IsLoaded)
{
timeline.RelativeChildSize = Vector2.One;
return;
}
var track = Beatmap.Value.Track;
if (!track.IsLoaded)
{
// the track may not be loaded completely (only has a length once it is).
Schedule(updateRelativeChildSize);
return;
}
timeline.RelativeChildSize = new Vector2((float)Math.Max(1, track.Length), 1);
timeline.RelativeChildSize = new Vector2((float)Math.Max(1, Beatmap.Value.Track.Length), 1);
}
protected void Add(Drawable visualisation) => timeline.Add(visualisation);