beardgame / utilities

General C# (game) utilities library, containing a variety of useful types and algorithms
MIT License
28 stars 14 forks source link

🐛 Fix Rectangle.FromSides creation #380

Closed tomrijnbeek closed 7 months ago

tomrijnbeek commented 7 months ago

✨ What's this?

This PR fixes the Rectangle.FromSides method to create the correct rectangle. Right now it has the X and Y dimensions flipped.

🔍 Why do we want this?

To have correctly oriented rectangles.

🏗 How is it done?

First added a test case to reproduce the bug, then fixed it. Also added some other basic test cases for similar code paths for consistency. We could be testing Rectangle much more but that was not the intent of this PR.

💥 Breaking changes

If people considered this a feature... they really shouldn't

🦋 Side effects

I disabled the .NET 5 tests since .NET 5 is no longer supported and it wouldn't run locally on my machine. We should probably stop supporting it altogether but I'll leave that to a separate PR.