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

correct for empty box shadow rects #1117

Merged
merged 1 commit into from Apr 13, 2017
Merged

Conversation

@changm
Copy link
Contributor

changm commented Apr 13, 2017

This change is Reviewable

@changm
Copy link
Contributor Author

changm commented Apr 13, 2017

The explicit empty check is to work around empty rects until we resolve servo/euclid#183 (comment)

@@ -786,9 +786,13 @@ impl FrameBuilder {

let bs_rect = box_bounds.translate(box_offset)
.inflate(inflate_amount, inflate_amount);
// If we have negative inflate amounts.
// Have to explicitly check this since euclid::TypedRect relies on negative rects
let bs_rect_empty = bs_rect.size.width <= 0.0 || bs_rect.size.height <= 0.0;

This comment has been minimized.

@kvark

kvark Apr 13, 2017

Member

should the conditions be < instead of <=, given the comment says "negative"?

This comment has been minimized.

@changm

changm Apr 13, 2017

Author Contributor

No, but I put "negative" there since Euclid correctly handles 0 sized rects. I can update the comment to reflect that if you want. I was hoping to just do bs_rect.is_empty().

@kvark
Copy link
Member

kvark commented Apr 13, 2017

@bors-servo
Copy link
Contributor

bors-servo commented Apr 13, 2017

📌 Commit f247be0 has been approved by kvark

@kvark kvark mentioned this pull request Apr 13, 2017
@bors-servo
Copy link
Contributor

bors-servo commented Apr 13, 2017

Testing commit f247be0 with merge 5ba060f...

bors-servo added a commit that referenced this pull request Apr 13, 2017
correct for empty box shadow rects

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

bors-servo commented Apr 13, 2017

☀️ Test successful - status-travis
Approved by: kvark
Pushing 5ba060f to master...

@bors-servo bors-servo merged commit f247be0 into servo:master Apr 13, 2017
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
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.