1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 19:22:54 +08:00

Make getTieredComponent local

This commit is contained in:
Robin Avery 2021-06-11 06:51:12 -04:00
parent 635300b311
commit a76eaeb52d
No known key found for this signature in database
GPG Key ID: 0496DF10CEF7E226

View File

@ -287,6 +287,17 @@ namespace osu.Game.Skinning.Editor
var result = default(Anchor);
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;
}
result |= getTieredComponent(absolutePosition.X / factor.X, Anchor.x0, Anchor.x1, Anchor.x2);
result |= getTieredComponent(absolutePosition.Y / factor.Y, Anchor.y0, Anchor.y1, Anchor.y2);
@ -310,17 +321,6 @@ namespace osu.Game.Skinning.Editor
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 static void applyAnchor(Drawable drawable, Anchor anchor)
{
if (anchor == drawable.Anchor) return;