thesadrogue / TheSadRogue.Primitives

A collection of primitive data structures for working with a 2-dimensional grid.
MIT License
21 stars 6 forks source link

Rectangle.Expand description isn't accurate. #54

Closed Thraka closed 3 years ago

Thraka commented 4 years ago

Rectangle.Expand says:

Returns a new rectangle, expanded to include the additional specified rows/columns.

I interpreted this to mean that the rows/columns are added to the right and bottom. I would adjust this to indicate what happens which is the rectangle expands on all sides by the specified amounts.

Chris3606 commented 4 years ago

Fair enough :D. There is a ChangeSize function that does what you're expecting. It's also worthy to mention that the Expand function is useful to shrink rectangles by giving negative changes; I frequently use rect.Expand(-1, -1).Positions() to iterate over only the inner points of a rectangle without touching the outer points.

With that in mind, any suggestions on a better name?