From d56ab0fe9af86a96ebf2fe3047d0b059b29aedbb Mon Sep 17 00:00:00 2001 From: Wleter Date: Tue, 29 Aug 2023 17:25:52 +0200 Subject: [PATCH] change names --- .../SkinEditor/SkinSelectionHandler.cs | 25 ++++++++++--------- .../Edit/Compose/Components/SelectionBox.cs | 2 +- .../SelectionBoxDragHandleContainer.cs | 2 +- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/osu.Game/Overlays/SkinEditor/SkinSelectionHandler.cs b/osu.Game/Overlays/SkinEditor/SkinSelectionHandler.cs index ff6b52ca4d..afa592dfba 100644 --- a/osu.Game/Overlays/SkinEditor/SkinSelectionHandler.cs +++ b/osu.Game/Overlays/SkinEditor/SkinSelectionHandler.cs @@ -73,18 +73,20 @@ namespace osu.Game.Overlays.SkinEditor adjustedRect.Width += scale.X; adjustedRect.Height += scale.Y; - if (adjustedRect.Width < 0) - { - SelectionBox.ScaleHandlesFlip(Direction.Horizontal); - HandleFlip(Direction.Horizontal, false); - } - if (adjustedRect.Height < 0) - { - SelectionBox.ScaleHandlesFlip(Direction.Vertical); - HandleFlip(Direction.Vertical, false); - } if (adjustedRect.Width < 0 || adjustedRect.Height < 0) + { + if (adjustedRect.Width < 0) + { + SelectionBox.FlipScaleHandles(Direction.Horizontal); + HandleFlip(Direction.Horizontal, false); + } + if (adjustedRect.Height < 0) + { + SelectionBox.FlipScaleHandles(Direction.Vertical); + HandleFlip(Direction.Vertical, false); + } return true; + } // scale adjust applied to each individual item should match that of the quad itself. var scaledDelta = new Vector2( @@ -113,9 +115,8 @@ namespace osu.Game.Overlays.SkinEditor updateDrawablePosition(drawableItem, newPositionInAdjusted); if (Precision.AlmostEquals(MathF.Abs(drawableItem.Rotation) % 180, 90)) - { scaledDelta = new Vector2(scaledDelta.Y, scaledDelta.X); - } + drawableItem.Scale *= scaledDelta; } diff --git a/osu.Game/Screens/Edit/Compose/Components/SelectionBox.cs b/osu.Game/Screens/Edit/Compose/Components/SelectionBox.cs index a261b635b3..bbf9ea8c3c 100644 --- a/osu.Game/Screens/Edit/Compose/Components/SelectionBox.cs +++ b/osu.Game/Screens/Edit/Compose/Components/SelectionBox.cs @@ -307,7 +307,7 @@ namespace osu.Game.Screens.Edit.Compose.Components return button; } - public void ScaleHandlesFlip(Direction direction) => dragHandles.ScaleHandlesFlip(direction); + public void FlipScaleHandles(Direction direction) => dragHandles.FlipScaleHandles(direction); private void addScaleHandle(Anchor anchor) { diff --git a/osu.Game/Screens/Edit/Compose/Components/SelectionBoxDragHandleContainer.cs b/osu.Game/Screens/Edit/Compose/Components/SelectionBoxDragHandleContainer.cs index 4fd2e9aba9..e7f69b7b37 100644 --- a/osu.Game/Screens/Edit/Compose/Components/SelectionBoxDragHandleContainer.cs +++ b/osu.Game/Screens/Edit/Compose/Components/SelectionBoxDragHandleContainer.cs @@ -70,7 +70,7 @@ namespace osu.Game.Screens.Edit.Compose.Components allDragHandles.Add(handle); } - public void ScaleHandlesFlip(Direction direction) + public void FlipScaleHandles(Direction direction) { foreach (var handle in scaleHandles) {