1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 06:52:56 +08:00

Fix hit error bar icon orientation

Icons now keep their original orientation when the hit error bar is
flipped
This commit is contained in:
outfoxxed 2022-10-16 02:55:10 -07:00
parent 10aabfc650
commit cd1885a17b
No known key found for this signature in database
GPG Key ID: 5775F651AC84FFE6

View File

@ -338,8 +338,26 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters
base.Update();
// undo any layout rotation to display icons in the correct orientation
if (labelEarly != null) labelEarly.Rotation = -Rotation;
if (labelLate != null) labelLate.Rotation = -Rotation;
bool xFlipped = Scale.X < 0;
bool yFlipped = Scale.Y < 0;
bool horizontal = Rotation == 90 || Rotation == -90;
bool flipX = (xFlipped && yFlipped) || (xFlipped && !horizontal) || (yFlipped && horizontal);
bool flipY = (xFlipped && yFlipped) || (xFlipped && horizontal) || (yFlipped && !horizontal);
Vector2 flipScale = new Vector2(flipX ? -1 : 1, flipY ? -1 : 1);
if (labelEarly != null)
{
labelEarly.Rotation = -Rotation;
labelEarly.Scale = flipScale;
}
if (labelLate != null)
{
labelLate.Rotation = -Rotation;
labelLate.Scale = flipScale;
}
}
private void createColourBars((HitResult result, double length)[] windows)