1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-22 21:40:49 +08:00

Bind using local bindables to avoid potentially event pollution

This commit is contained in:
Dean Herbert
2024-04-02 13:04:34 +08:00
Unverified
parent 1adba68357
commit ed5dd5c8cd
@@ -22,6 +22,9 @@ namespace osu.Game.Rulesets.Osu.Edit
private EditorToolButton rotateButton = null!;
private Bindable<bool> canRotatePlayfieldOrigin = null!;
private Bindable<bool> canRotateSelectionOrigin = null!;
public SelectionRotationHandler RotationHandler { get; init; } = null!;
public TransformToolboxGroup()
@@ -52,8 +55,11 @@ namespace osu.Game.Rulesets.Osu.Edit
base.LoadComplete();
// aggregate two values into canRotate
RotationHandler.CanRotatePlayfieldOrigin.BindValueChanged(_ => updateCanRotateAggregate());
RotationHandler.CanRotateSelectionOrigin.BindValueChanged(_ => updateCanRotateAggregate());
canRotatePlayfieldOrigin = RotationHandler.CanRotatePlayfieldOrigin.GetBoundCopy();
canRotatePlayfieldOrigin.BindValueChanged(_ => updateCanRotateAggregate());
canRotateSelectionOrigin = RotationHandler.CanRotateSelectionOrigin.GetBoundCopy();
canRotateSelectionOrigin.BindValueChanged(_ => updateCanRotateAggregate());
void updateCanRotateAggregate()
{