Merge pull request #21094 from smoogipoo/fix-velocity-test

Fix velocity test failing with no audio device
This commit is contained in:
Dean Herbert 2022-11-03 15:18:49 +09:00 committed by GitHub
commit 94a34071f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 9 deletions

View File

@ -57,15 +57,13 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts
private void updateRelativeChildSize()
{
// the track may not be loaded completely (only has a length once it is).
if (!beatmap.Value.Track.IsLoaded)
{
content.RelativeChildSize = Vector2.One;
Schedule(updateRelativeChildSize);
return;
}
// If the track is not loaded, assign a default sane length otherwise relative positioning becomes meaningless.
double trackLength = beatmap.Value.Track.IsLoaded ? beatmap.Value.Track.Length : 60000;
content.RelativeChildSize = new Vector2((float)Math.Max(1, trackLength), 1);
content.RelativeChildSize = new Vector2((float)Math.Max(1, beatmap.Value.Track.Length), 1);
// The track may not be loaded completely (only has a length once it is).
if (!beatmap.Value.Track.IsLoaded)
Schedule(updateRelativeChildSize);
}
protected virtual void LoadBeatmap(EditorBeatmap beatmap)

View File

@ -27,7 +27,7 @@ namespace osu.Game.Screens.Edit
private readonly Bindable<Track> track = new Bindable<Track>();
public double TrackLength => track.Value?.Length ?? 60000;
public double TrackLength => track.Value?.IsLoaded == true ? track.Value.Length : 60000;
public ControlPointInfo ControlPointInfo => Beatmap.ControlPointInfo;