Fix CA2208

This commit is contained in:
RoosterDragon
2023-03-13 18:20:11 +00:00
committed by abcdefg30
parent 1b1b9dc29b
commit a120b9d37e
2 changed files with 4 additions and 2 deletions

View File

@@ -819,6 +819,9 @@ dotnet_diagnostic.CA2200.severity = warning
# Initialize value type static fields inline.
dotnet_diagnostic.CA2207.severity = warning
# Instantiate argument exceptions correctly.
dotnet_diagnostic.CA2208.severity = warning
# Dispose methods should call base class dispose.
dotnet_diagnostic.CA2215.severity = warning

View File

@@ -263,11 +263,10 @@ namespace OpenRA.Mods.Common.Widgets
case TextAlign.Left:
return new int2(rb.X + LeftMargin, y);
case TextAlign.Center:
default:
return new int2(rb.X + (UsableWidth - textSize.X) / 2, y);
case TextAlign.Right:
return new int2(rb.X + UsableWidth - textSize.X - RightMargin, y);
default:
throw new ArgumentOutOfRangeException("Align");
}
}