Use Enum.HasFlag

With .NET core 2.0+ this is as efficient as the ugly code we've been using.
This commit is contained in:
Dean Herbert
2018-07-16 16:17:22 +09:00
parent bb7d0715b1
commit dbc538abbe
13 changed files with 55 additions and 54 deletions

View File

@ -118,9 +118,9 @@ namespace osu.Game.Overlays.Toolbar
{
Direction = FillDirection.Vertical,
RelativeSizeAxes = Axes.Both, //stops us being considered in parent's autosize
Anchor = (TooltipAnchor & Anchor.x0) > 0 ? Anchor.BottomLeft : Anchor.BottomRight,
Anchor = TooltipAnchor.HasFlag(Anchor.x0) ? Anchor.BottomLeft : Anchor.BottomRight,
Origin = TooltipAnchor,
Position = new Vector2((TooltipAnchor & Anchor.x0) > 0 ? 5 : -5, 5),
Position = new Vector2(TooltipAnchor.HasFlag(Anchor.x0) ? 5 : -5, 5),
Alpha = 0,
Children = new[]
{