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
Implement rounded rectangle stroke #111
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! if we can move the stroke_border_radius_build
into the loop it'd be perfect, otherwise the PR is already in a good shape and we can merge it.
tessellation/src/basic_shapes.rs
Outdated
let p4 = point(x_max, y_max - br); | ||
|
||
let sides = &[ | ||
[p1, p2], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: let's indent this one extra level.
tessellation/src/basic_shapes.rs
Outdated
&mut builder, | ||
); | ||
for i in 1..4 { | ||
builder.line_to(sides[i][0]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the end of the previous iteration already going to finish at this position? If we can make it so, then you could even move the line_to
and the stroke_border_radius_build
above into the loop (and just have the move_to
outside the loop).
moved the first |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat.
Thanks a lot! |
Fixes #38.
The problem with the #82 was the segmentation of the shape, which could result in a mismatch between the different parts. This is addressed by producing one continuous shape, and by finding only the inner points in rounded borders (since the outer ones could be part of other paths).