From 61fd4186af8781af2791e6760d925760beba8f21 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 5 Oct 2023 22:55:23 +0900 Subject: [PATCH] Ensure `regenerateDisplay` is eventually performed if originally called before load --- osu.Game/Screens/Edit/Timing/WaveformComparisonDisplay.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Edit/Timing/WaveformComparisonDisplay.cs b/osu.Game/Screens/Edit/Timing/WaveformComparisonDisplay.cs index d598b2cfbf..856bc7c303 100644 --- a/osu.Game/Screens/Edit/Timing/WaveformComparisonDisplay.cs +++ b/osu.Game/Screens/Edit/Timing/WaveformComparisonDisplay.cs @@ -94,7 +94,7 @@ namespace osu.Game.Screens.Edit.Timing controlPointGroups.BindTo(editorBeatmap.ControlPointInfo.Groups); controlPointGroups.BindCollectionChanged((_, _) => updateTimingGroup()); - beatLength.BindValueChanged(_ => regenerateDisplay(true), true); + beatLength.BindValueChanged(_ => Scheduler.AddOnce(regenerateDisplay, true), true); displayLocked.BindValueChanged(locked => { @@ -186,14 +186,17 @@ namespace osu.Game.Screens.Edit.Timing return; displayedTime = time; - regenerateDisplay(animated); + Scheduler.AddOnce(regenerateDisplay, animated); } private void regenerateDisplay(bool animated) { // Before a track is loaded, it won't have a valid length, which will break things. if (!beatmap.Value.Track.IsLoaded) + { + Scheduler.AddOnce(regenerateDisplay, animated); return; + } double index = (displayedTime - selectedGroupStartTime) / timingPoint.BeatLength;