Fix scale popover doing things when both scale axes are turned off

Spotted in passing when reviewing https://github.com/ppy/osu/pull/30080.
The popover would very arbitrarily revert to scaling by Y axis if both
checkboxes were checked off.

Not sure how this passed review.
This commit is contained in:
Bartłomiej Dach 2024-10-11 15:18:43 +02:00
parent 616c2aeefc
commit 4e8e4a34bd
No known key found for this signature in database
1 changed files with 12 additions and 1 deletions

View File

@ -219,7 +219,18 @@ private void setOrigin(ScaleOrigin origin)
}
}
private Axes getAdjustAxis(PreciseScaleInfo scale) => scale.XAxis ? scale.YAxis ? Axes.Both : Axes.X : Axes.Y;
private Axes getAdjustAxis(PreciseScaleInfo scale)
{
var result = Axes.None;
if (scale.XAxis)
result |= Axes.X;
if (scale.YAxis)
result |= Axes.Y;
return result;
}
private float getRotation(PreciseScaleInfo scale) => scale.Origin == ScaleOrigin.GridCentre ? gridToolbox.GridLinesRotation.Value : 0;