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

Add center method to Rect #450

Merged
merged 1 commit into from
May 8, 2020
Merged

Add center method to Rect #450

merged 1 commit into from
May 8, 2020

Conversation

mbrobbel
Copy link
Contributor

@mbrobbel mbrobbel commented May 8, 2020

This is an attempt to close #448.
This is my first contribution to this project, so I'm happy to learn how to improve.

  • Added a center method to Rect that returns the center Coordinate of the Rect.
  • Implemented the approx crate traits for Coordinate to enable usage of the assert_relative_eq macro in tests for this type.
  • Added some documention including simple examples for other Rect methods.
  • Rect Centroid impl now uses the center method.

Copy link
Member

@michaelkirk michaelkirk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thanks for all the docs/tests!

Copy link
Member

@frewsxcv frewsxcv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you!

@frewsxcv
Copy link
Member

frewsxcv commented May 8, 2020

bors r+

@urschrei
Copy link
Member

urschrei commented May 8, 2020

Thanks!

@urschrei urschrei closed this May 8, 2020
@urschrei urschrei reopened this May 8, 2020
@bors
Copy link
Contributor

bors bot commented May 8, 2020

Build succeeded:

@bors bors bot merged commit 2b741ae into georust:master May 8, 2020
@mbrobbel mbrobbel deleted the rect-center branch May 8, 2020 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Introduce Rect#center method to return Coordinate at center of rectangle
4 participants