-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove HasFlagFast() extension, restore Enum.HasFlag()
- Loading branch information
1 parent
499035a
commit 9ec070a
Showing
3 changed files
with
8 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
// Copyright (c) karaoke.dev <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using osu.Framework.Extensions.EnumExtensions; | ||
using osu.Framework.Graphics.Primitives; | ||
using osuTK; | ||
|
||
|
@@ -24,27 +23,27 @@ public static RectangleF Scale(this RectangleF source, Vector2 scale, Anchor ori | |
|
||
static float getXScale(Anchor origin) | ||
{ | ||
if (origin.HasFlagFast(Anchor.x0)) | ||
if (origin.HasFlag(Anchor.x0)) | ||
return 0; | ||
|
||
if (origin.HasFlagFast(Anchor.x1)) | ||
if (origin.HasFlag(Anchor.x1)) | ||
return 0.5f; | ||
|
||
if (origin.HasFlagFast(Anchor.x2)) | ||
if (origin.HasFlag(Anchor.x2)) | ||
return 1f; | ||
|
||
return 100; | ||
} | ||
|
||
static float getYScale(Anchor origin) | ||
{ | ||
if (origin.HasFlagFast(Anchor.y0)) | ||
if (origin.HasFlag(Anchor.y0)) | ||
return 0; | ||
|
||
if (origin.HasFlagFast(Anchor.y1)) | ||
if (origin.HasFlag(Anchor.y1)) | ||
return 0.5f; | ||
|
||
if (origin.HasFlagFast(Anchor.y2)) | ||
if (origin.HasFlag(Anchor.y2)) | ||
return 1f; | ||
|
||
return 100; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters