diff --git a/osu.Game/Skinning/Editor/SkinSelectionHandler.cs b/osu.Game/Skinning/Editor/SkinSelectionHandler.cs index 5619a7ba19..b1d353b0af 100644 --- a/osu.Game/Skinning/Editor/SkinSelectionHandler.cs +++ b/osu.Game/Skinning/Editor/SkinSelectionHandler.cs @@ -69,19 +69,23 @@ namespace osu.Game.Skinning.Editor var result = default(Anchor); - static Anchor getTieredComponent(float component, Anchor tier0, Anchor tier1, Anchor tier2) => - component >= 2 / 3f - ? tier2 - : component >= 1 / 3f - ? tier1 - : tier0; - result |= getTieredComponent(absolutePosition.X / factor.X, Anchor.x0, Anchor.x1, Anchor.x2); result |= getTieredComponent(absolutePosition.Y / factor.Y, Anchor.y0, Anchor.y1, Anchor.y2); return result; } + private static Anchor getTieredComponent(float component, Anchor tier0, Anchor tier1, Anchor tier2) + { + if (component >= 2 / 3f) + return tier2; + + if (component >= 1 / 3f) + return tier1; + + return tier0; + } + private Vector2 getOriginPositionFromQuad(in Quad quad, Anchor origin) { var result = quad.TopLeft;