Fix rotation popover potentially crashing due to activating selection origin just before disabling it

This commit is contained in:
Bartłomiej Dach 2024-11-04 10:58:48 +01:00
parent 3a3471c202
commit e2a4a9b300
No known key found for this signature in database

View File

@ -103,6 +103,11 @@ namespace osu.Game.Rulesets.Osu.Edit
});
angleInput.Current.BindValueChanged(angle => rotationInfo.Value = rotationInfo.Value with { Degrees = angle.NewValue });
rotationHandler.CanRotateAroundSelectionOrigin.BindValueChanged(e =>
{
selectionCentreButton.Selected.Disabled = !e.NewValue;
}, true);
bool didSelect = false;
configRotationOrigin.BindValueChanged(val =>
@ -154,11 +159,6 @@ namespace osu.Game.Rulesets.Osu.Edit
if (b.NewValue) configRotationOrigin.Value = EditorOrigin.SelectionCentre;
});
rotationHandler.CanRotateAroundSelectionOrigin.BindValueChanged(e =>
{
selectionCentreButton.Selected.Disabled = !e.NewValue;
}, true);
rotationInfo.BindValueChanged(rotation =>
{
rotationHandler.Update(rotation.NewValue.Degrees, getOriginPosition(rotation.NewValue));