mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 14:12:55 +08:00
Improve performance of refreshes
This commit is contained in:
parent
712253ff50
commit
a19e26f8aa
@ -31,7 +31,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Connections
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
bindHitObject(Start);
|
||||
bindEvents(Start);
|
||||
}
|
||||
|
||||
private DrawableOsuHitObject end;
|
||||
@ -48,20 +48,21 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Connections
|
||||
end = value;
|
||||
|
||||
if (end != null)
|
||||
bindHitObject(end);
|
||||
bindEvents(end);
|
||||
|
||||
refreshFollowPoints();
|
||||
refresh();
|
||||
}
|
||||
}
|
||||
|
||||
private void bindHitObject(DrawableOsuHitObject drawableObject)
|
||||
private void bindEvents(DrawableOsuHitObject drawableObject)
|
||||
{
|
||||
drawableObject.HitObject.StartTimeBindable.BindValueChanged(_ => refreshFollowPoints());
|
||||
drawableObject.HitObject.PositionBindable.BindValueChanged(_ => refreshFollowPoints());
|
||||
drawableObject.HitObject.DefaultsApplied += refreshFollowPoints;
|
||||
drawableObject.HitObject.PositionBindable.BindValueChanged(_ => scheduleRefresh());
|
||||
drawableObject.HitObject.DefaultsApplied += scheduleRefresh;
|
||||
}
|
||||
|
||||
private void refreshFollowPoints()
|
||||
private void scheduleRefresh() => Scheduler.AddOnce(refresh);
|
||||
|
||||
private void refresh()
|
||||
{
|
||||
ClearInternal();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user