1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-14 15:57:24 +08:00

Fix skin editor closest origin selection spazzing out on scaled sprites

Closes https://github.com/ppy/osu/issues/28215.

`drawable.Position` is a location in the parent's coordinate space, and
`drawable.OriginPosition` is in the drawable's local space and
additionally does not take scale into account.
This commit is contained in:
Bartłomiej Dach 2024-05-20 09:43:25 +02:00
parent dedc2d2aa0
commit c03f68413a
No known key found for this signature in database

View File

@ -425,9 +425,9 @@ namespace osu.Game.Overlays.SkinEditor
{ {
if (origin == drawable.Origin) return; if (origin == drawable.Origin) return;
var previousOrigin = drawable.OriginPosition; var previousOrigin = drawable.ToParentSpace(drawable.OriginPosition);
drawable.Origin = origin; drawable.Origin = origin;
drawable.Position += drawable.OriginPosition - previousOrigin; drawable.Position += drawable.ToParentSpace(drawable.OriginPosition) - previousOrigin;
} }
private static void adjustScaleFromAnchor(ref Vector2 scale, Anchor reference) private static void adjustScaleFromAnchor(ref Vector2 scale, Anchor reference)