mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 10:33:30 +08:00
Fix timeline not updating ticks correctly after arbitrary timing control point changes
This commit is contained in:
parent
6b79d96517
commit
190c6ef45e
@ -25,6 +25,9 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
||||
[Resolved]
|
||||
private BindableBeatDivisor beatDivisor { get; set; }
|
||||
|
||||
[Resolved]
|
||||
private IEditorChangeHandler changeHandler { get; set; }
|
||||
|
||||
[Resolved]
|
||||
private OsuColour colours { get; set; }
|
||||
|
||||
@ -38,7 +41,15 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
beatDivisor.BindValueChanged(_ => tickCache.Invalidate());
|
||||
beatDivisor.BindValueChanged(_ => invalidateTicks());
|
||||
|
||||
// currently this is the best way to handle any kind of timing changes.
|
||||
changeHandler.OnStateChange += invalidateTicks;
|
||||
}
|
||||
|
||||
private void invalidateTicks()
|
||||
{
|
||||
tickCache.Invalidate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -165,5 +176,13 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
||||
return point;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void Dispose(bool isDisposing)
|
||||
{
|
||||
base.Dispose(isDisposing);
|
||||
|
||||
if (changeHandler != null)
|
||||
changeHandler.OnStateChange -= invalidateTicks;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user