mirror of https://github.com/ppy/osu
Bind using local bindables to avoid potentially event pollution
This commit is contained in:
parent
1adba68357
commit
ed5dd5c8cd
|
@ -22,6 +22,9 @@ public partial class TransformToolboxGroup : EditorToolboxGroup, IKeyBindingHand
|
|||
|
||||
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 @@ protected override void LoadComplete()
|
|||
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()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue