Skip to content

Commit

Permalink
Fix CA2208
Browse files Browse the repository at this point in the history
  • Loading branch information
RoosterDragon authored and abcdefg30 committed Apr 16, 2023
1 parent 1b1b9dc commit a120b9d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 1 addition & 2 deletions OpenRA.Mods.Common/Widgets/ButtonWidget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -263,11 +263,10 @@ int2 GetTextPosition(string text, SpriteFont font, Rectangle rb)
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");
}
}

Expand Down

0 comments on commit a120b9d

Please sign in to comment.