1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 17:32:54 +08:00

Fix bindings not correctly being cleaned up in OsuHitObjectComposer

This commit is contained in:
Dean Herbert 2020-09-21 18:15:33 +09:00
parent 896aa7f3ea
commit 842f8bea55

View File

@ -46,13 +46,20 @@ namespace osu.Game.Rulesets.Osu.Edit
distanceSnapToggle distanceSnapToggle
}; };
private BindableList<HitObject> selectedHitObjects;
private Bindable<HitObject> placementObject;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()
{ {
LayerBelowRuleset.Add(distanceSnapGridContainer = new Container { RelativeSizeAxes = Axes.Both }); LayerBelowRuleset.Add(distanceSnapGridContainer = new Container { RelativeSizeAxes = Axes.Both });
EditorBeatmap.SelectedHitObjects.CollectionChanged += (_, __) => updateDistanceSnapGrid(); selectedHitObjects = EditorBeatmap.SelectedHitObjects.GetBoundCopy();
EditorBeatmap.PlacementObject.ValueChanged += _ => updateDistanceSnapGrid(); selectedHitObjects.CollectionChanged += (_, __) => updateDistanceSnapGrid();
placementObject = EditorBeatmap.PlacementObject.GetBoundCopy();
placementObject.ValueChanged += _ => updateDistanceSnapGrid();
distanceSnapToggle.ValueChanged += _ => updateDistanceSnapGrid(); distanceSnapToggle.ValueChanged += _ => updateDistanceSnapGrid();
} }