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 inner_rect and outer_rect methods to Rect #260

Merged
merged 1 commit into from
Jan 14, 2018
Merged

Add inner_rect and outer_rect methods to Rect #260

merged 1 commit into from
Jan 14, 2018

Conversation

pyfisch
Copy link
Contributor

@pyfisch pyfisch commented Jan 14, 2018

Closes #258

cc @nical

Note: The outer_rect method is similar to the existing inflate method but more powerful. If SideOffsets2D hat a constructor taking two offsets one for each direction the inflate method could be removed I guess.


This change is Reviewable

src/rect.rs Outdated
self.size.height - offsets.vertical()
)
);
assert!(rect.size.width >= Zero::zero());
Copy link
Contributor

Choose a reason for hiding this comment

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

I would prefer this to be a debug assertion.

@pyfisch
Copy link
Contributor Author

pyfisch commented Jan 14, 2018

Changed to debug_assert!

@nical
Copy link
Contributor

nical commented Jan 14, 2018

Thanks! @bors-servo r+

@bors-servo
Copy link
Contributor

📌 Commit d2ff23e has been approved by nical

@bors-servo
Copy link
Contributor

⌛ Testing commit d2ff23e with merge f2c9c75...

bors-servo pushed a commit that referenced this pull request Jan 14, 2018
Add inner_rect and outer_rect methods to Rect

Closes #258

cc @nical

Note: The `outer_rect` method is similar to the existing `inflate` method but more powerful. If `SideOffsets2D` hat a constructor taking two offsets one for each direction the `inflate` method could be removed I guess.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/euclid/260)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

☀️ Test successful - status-travis
Approved by: nical
Pushing f2c9c75 to master...

@bors-servo bors-servo merged commit d2ff23e into servo:master Jan 14, 2018
@pyfisch pyfisch deleted the inner-outer-rect branch January 14, 2018 21:31
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.

3 participants