Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rectangle should be immutable #40

Closed
Chris3606 opened this issue Jul 12, 2018 · 0 comments
Closed

Rectangle should be immutable #40

Chris3606 opened this issue Jul 12, 2018 · 0 comments
Assignees

Comments

@Chris3606
Copy link
Owner

Rectangle is a struct (value-type), and therefore should be immutable to avoid accidentally modifying temporary boxed values.

Convenience functions such as Rectangle.ChangeCenter could be provided that take a center point and return a new rectangle modified to have that center, to allow for convenient modification.

@Chris3606 Chris3606 self-assigned this Jul 12, 2018
Chris3606 added a commit that referenced this issue Jul 12, 2018
…eate new rectangles. This fixes issue #40.  Also changed centering code to fix issue #41.  Created Created BoundedRectangle, and edited Viewport to use it. Changed property exposure to be references to the appropriate value-types.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant