Skip to content

Commit

Permalink
Fix rotation popover potentially crashing due to activating selection…
Browse files Browse the repository at this point in the history
… origin just before disabling it
  • Loading branch information
bdach committed Nov 4, 2024
1 parent 3a3471c commit e2a4a9b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions osu.Game.Rulesets.Osu/Edit/PreciseRotationPopover.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ protected override void LoadComplete()
});
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 =>
Expand Down Expand Up @@ -154,11 +159,6 @@ protected override void LoadComplete()
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));
Expand Down

0 comments on commit e2a4a9b

Please sign in to comment.