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

Conversation

@pyfisch
Copy link
Contributor

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());

This comment has been minimized.

@nical

nical Jan 14, 2018

Collaborator

I would prefer this to be a debug assertion.

Closes #258
@pyfisch pyfisch force-pushed the pyfisch:inner-outer-rect branch from dff6837 to d2ff23e Jan 14, 2018
@pyfisch
Copy link
Contributor Author

pyfisch commented Jan 14, 2018

Changed to debug_assert!

@nical
Copy link
Collaborator

nical commented Jan 14, 2018

Thanks! @bors-servo r+

@bors-servo
Copy link
Contributor

bors-servo commented Jan 14, 2018

📌 Commit d2ff23e has been approved by nical

@bors-servo
Copy link
Contributor

bors-servo commented Jan 14, 2018

Testing commit d2ff23e with merge f2c9c75...

bors-servo added 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

bors-servo commented Jan 14, 2018

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

@bors-servo bors-servo merged commit d2ff23e into servo:master Jan 14, 2018
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@pyfisch pyfisch deleted the pyfisch:inner-outer-rect branch Jan 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.