Repository navigation
Snap rectangles to nearest pixels consistently. - #7161
Merged
Merged
Conversation
Contributor
|
@bors-servo: r+ |
Contributor
|
📌 Commit 80e59cc has been approved by |
Contributor
bors-servo
pushed a commit
that referenced
this pull request
Aug 11, 2015
Snap rectangles to nearest pixels consistently. Snapping the top-left and bottom-right corners separately can cause a rectangle to change size or even become empty when offset by a subpixel amount. Instead, this patch snaps the top-left corner, then snaps the size to a whole pixel amount, so any rectangle of a given original size will always have the same snapped size. Fixes #7152. r? @pcwalton or @glennw <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7161) <!-- Reviewable:end -->
Contributor
|
I'd expect CSS tests to pass due to this, but if you've run them that's fine |
Contributor
|
💔 Test failed - linux2 |
Contributor
|
Contributor
Author
|
@bors-servo retry
I suspect this is intermittent, since it is still failing on the Mac builder, and I've seen unexpected PASS from this test on my personal Linux box, even without this patch. I'll file an issue if this retry proves me right. |
Contributor
Contributor
|
💔 Test failed - linux2 |
Snapping the top-left and bottom-right corners separately can cause a rectangle to change size when offset by a subpixel amount. Instead, this patch snaps the top-left corner, then rounds the size to a whole pixel amount, so any rectangle of a given size will always have the same snapped size. Fixes servo#7152.
Contributor
Author
|
@bors-servo r=pcwalton Adjusted test expectation. |
Contributor
|
📌 Commit 3b6dc09 has been approved by |
Contributor
|
⌛ Testing commit 3b6dc09 with merge 9c528c6... |
bors-servo
pushed a commit
that referenced
this pull request
Aug 11, 2015
Snap rectangles to nearest pixels consistently. Snapping the top-left and bottom-right corners separately can cause a rectangle to change size or even become empty when offset by a subpixel amount. Instead, this patch snaps the top-left corner, then snaps the size to a whole pixel amount, so any rectangle of a given original size will always have the same snapped size. Fixes #7152. r? @pcwalton or @glennw <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7161) <!-- Reviewable:end -->
Contributor
28 of 40 tasks
bjwbell
added a commit
to bjwbell/servo
that referenced
this pull request
Sep 9, 2015
There is no easy way to pass position-relative-035 & also pass both tests/ref/border_rounding_1px_invisible_issue_7184 and tests/ref/text_decoration_underline_subpx. servo#7161, "Snap rectangles to nearest pixels...", did fix position-relative-035 (except for OS X) but broke 1px borders.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Snapping the top-left and bottom-right corners separately can cause a rectangle to change size or even become empty when offset by a subpixel amount. Instead, this patch snaps the top-left corner, then snaps the size to a whole pixel amount, so any rectangle of a given original size will always have the same snapped size.
Fixes #7152. r? @pcwalton or @glennw