Fix CA2208
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user