From a55879e5115895c940411bc9d7000532e32d5219 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 20 May 2021 01:47:31 +0900 Subject: [PATCH] Fix oversights in scale algorithm --- osu.Game/Skinning/Editor/SkinSelectionHandler.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/osu.Game/Skinning/Editor/SkinSelectionHandler.cs b/osu.Game/Skinning/Editor/SkinSelectionHandler.cs index af013bfd52..2f9611ba65 100644 --- a/osu.Game/Skinning/Editor/SkinSelectionHandler.cs +++ b/osu.Game/Skinning/Editor/SkinSelectionHandler.cs @@ -32,6 +32,9 @@ namespace osu.Game.Skinning.Editor public override bool HandleScale(Vector2 scale, Anchor anchor) { + // convert scale to screen space + scale = ToScreenSpace(scale) - ToScreenSpace(Vector2.Zero); + adjustScaleFromAnchor(ref scale, anchor); var selectionQuad = GetSurroundingQuad(SelectedBlueprints.SelectMany(b => @@ -66,8 +69,8 @@ namespace osu.Game.Skinning.Editor // scale adjust should match that of the quad itself. var scaledDelta = new Vector2( - adjustedRect.Width / selectionQuad.Width - 1, - adjustedRect.Height / selectionQuad.Height - 1 + adjustedRect.Width / selectionQuad.Width, + adjustedRect.Height / selectionQuad.Height ); foreach (var b in SelectedBlueprints) @@ -89,7 +92,7 @@ namespace osu.Game.Skinning.Editor ); drawableItem.Position = drawableItem.Parent.ToLocalSpace(newPositionInAdjusted) - drawableItem.AnchorPosition; - drawableItem.Scale += scaledDelta; + drawableItem.Scale *= scaledDelta; } return true;