mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 12:33:01 +08:00
fix adjusting scale from anchor
This commit is contained in:
parent
6a4129dad8
commit
0fc448f4f3
@ -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)))
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user