mirror of
https://github.com/osukey/osukey.git
synced 2025-08-06 16:13:57 +09:00
Merge pull request #11032 from peppy/editor-fix-ticks-updating-after-timing-change
Fix timeline not updating ticks correctly after arbitrary timing control point changes
This commit is contained in:
@ -25,6 +25,9 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private BindableBeatDivisor beatDivisor { get; set; }
|
private BindableBeatDivisor beatDivisor { get; set; }
|
||||||
|
|
||||||
|
[Resolved(CanBeNull = true)]
|
||||||
|
private IEditorChangeHandler changeHandler { get; set; }
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private OsuColour colours { get; set; }
|
private OsuColour colours { get; set; }
|
||||||
|
|
||||||
@ -38,7 +41,16 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
beatDivisor.BindValueChanged(_ => tickCache.Invalidate());
|
beatDivisor.BindValueChanged(_ => invalidateTicks());
|
||||||
|
|
||||||
|
if (changeHandler != null)
|
||||||
|
// currently this is the best way to handle any kind of timing changes.
|
||||||
|
changeHandler.OnStateChange += invalidateTicks;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void invalidateTicks()
|
||||||
|
{
|
||||||
|
tickCache.Invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -165,5 +177,13 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
return point;
|
return point;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void Dispose(bool isDisposing)
|
||||||
|
{
|
||||||
|
base.Dispose(isDisposing);
|
||||||
|
|
||||||
|
if (changeHandler != null)
|
||||||
|
changeHandler.OnStateChange -= invalidateTicks;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user