1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 10:12:54 +08:00

fix adjusting scale from anchor

This commit is contained in:
OliBomby 2024-01-20 15:12:48 +01:00
parent 6a4129dad8
commit 0fc448f4f3
2 changed files with 3 additions and 3 deletions

View File

@ -91,7 +91,7 @@ namespace osu.Game.Overlays.SkinEditor
Debug.Assert(originalWidths != null && originalHeights != null && originalScales != null && originalPositions != null && defaultOrigin != null && OriginalSurroundingQuad != null);
var actualOrigin = origin ?? defaultOrigin.Value;
Axes adjustAxis = scale.X == 0 ? Axes.Y : scale.Y == 0 ? Axes.X : Axes.Both;
Axes adjustAxis = scale.X == 1 ? Axes.Y : scale.Y == 1 ? Axes.X : Axes.Both;
if ((adjustAxis == Axes.Y && !allSelectedSupportManualSizing(Axes.Y)) ||
(adjustAxis == Axes.X && !allSelectedSupportManualSizing(Axes.X)))

View File

@ -100,8 +100,8 @@ namespace osu.Game.Screens.Edit.Compose.Components
private void adjustScaleFromAnchor(ref Vector2 scale)
{
// cancel out scale in axes we don't care about (based on which drag handle was used).
if ((originalAnchor & Anchor.x1) > 0) scale.X = 1;
if ((originalAnchor & Anchor.y1) > 0) scale.Y = 1;
if ((originalAnchor & Anchor.x1) > 0) scale.X = 0;
if ((originalAnchor & Anchor.y1) > 0) scale.Y = 0;
// reverse the scale direction if dragging from top or left.
if ((originalAnchor & Anchor.x0) > 0) scale.X = -scale.X;