mirror of
https://github.com/ppy/osu.git
synced 2025-03-28 10:17:19 +08:00
Merge pull request #21094 from smoogipoo/fix-velocity-test
Fix velocity test failing with no audio device
This commit is contained in:
commit
94a34071f5
@ -57,15 +57,13 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts
|
|||||||
|
|
||||||
private void updateRelativeChildSize()
|
private void updateRelativeChildSize()
|
||||||
{
|
{
|
||||||
// the track may not be loaded completely (only has a length once it is).
|
// If the track is not loaded, assign a default sane length otherwise relative positioning becomes meaningless.
|
||||||
if (!beatmap.Value.Track.IsLoaded)
|
double trackLength = beatmap.Value.Track.IsLoaded ? beatmap.Value.Track.Length : 60000;
|
||||||
{
|
content.RelativeChildSize = new Vector2((float)Math.Max(1, trackLength), 1);
|
||||||
content.RelativeChildSize = Vector2.One;
|
|
||||||
Schedule(updateRelativeChildSize);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
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)
|
protected virtual void LoadBeatmap(EditorBeatmap beatmap)
|
||||||
|
@ -27,7 +27,7 @@ namespace osu.Game.Screens.Edit
|
|||||||
|
|
||||||
private readonly Bindable<Track> track = new Bindable<Track>();
|
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;
|
public ControlPointInfo ControlPointInfo => Beatmap.ControlPointInfo;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user