Ensure toggles are not instantiated more than once for safety

This commit is contained in:
Dean Herbert
2020-09-25 17:40:43 +09:00
parent b8e9f19b92
commit 22511c36c3
3 changed files with 18 additions and 11 deletions

View File

@ -44,7 +44,7 @@ namespace osu.Game.Rulesets.Osu.Edit
private readonly Bindable<TernaryState> distanceSnapToggle = new Bindable<TernaryState>();
protected override IEnumerable<TernaryButton> Toggles => base.Toggles.Concat(new[]
protected override IEnumerable<TernaryButton> CreateToggles() => base.CreateToggles().Concat(new[]
{
new TernaryButton(distanceSnapToggle, "Distance Snap", () => new SpriteIcon { Icon = FontAwesome.Solid.Ruler })
});