Repository navigation
gfx: Border radius support for asymmetric sized borders - #7370
Conversation
|
Not at all something for me. r? @SimonSapin |
|
@SimonSapin ping or @pcwalton could review. Either one :-) I have the code for adding almost all of elliptical border radius support ready to go after this PR. |
There was a problem hiding this comment.
presumably should be discriminant
There was a problem hiding this comment.
Thanks for the catch. Sorry about that.
|
Do WebKit and Gecko implement the same algorithm? I'd like to see some comparisons between the way we do it and the way other browser engines do this. |
There was a problem hiding this comment.
nit: only one space after ,
|
@pcwalton Gecko implements essentially the same algorithm (IntersectBorderRadius - https://dxr.mozilla.org/mozilla-central/source/layout/base/nsCSSRenderingBorders.cpp#1082). |
|
@pcwalton the code should be ready to review again. |
|
Looks good. Squash if you'd like, then I'll r+! |
This change adds support for calculating the correct angle in the border corner arc when switching from one border to another e.g. the left border to the top border. When the border-top/right/bottom/left-widths are not the same, the angle on the border corner arc separating the borders isn't pi/4. For example, if the top border width is much larger than the left border width then most of the border corner should be drawn using the top border color. Elliptical border radii are supported for when elliptical border radii are added. The common case where borders have the same width sets the angle to pi/4 directly. A ref test is also included.
7efe11a to
d539b9b
Compare
|
@bors-servo: r+ |
|
📌 Commit d539b9b has been approved by |
gfx: Border radius support for asymmetric sized borders When the border-top/right/bottom/left-widths are not equal, the angle on the border corner arc separating the borders isn't PI/4. For instance if the top border width is much larger than the left border width then most of the border corner should be drawn using the top border color. This change adds support for calculating the correct angle in the border corner arc for switching from one border to another e.g. the left border to the top border. It supports elliptical border radii for when elliptical border radii are added. A ref test is also included. r? @Ms2ger <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7370) <!-- Reviewable:end -->
When the border-top/right/bottom/left-widths are not equal, the angle on the border corner arc separating the borders isn't PI/4.
For instance if the top border width is much larger than the left border width then most of the border corner should be drawn using the top border color.
This change adds support for calculating the correct angle in the border
corner arc for switching from one border to another e.g. the left border
to the top border.
It supports elliptical border radii for when elliptical border radii are
added.
A ref test is also included.
r? @Ms2ger