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
1 changed files with 3 additions and 10 deletions

View File

@ -32,22 +32,15 @@ protected TimelinePart()
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);