-
-
Notifications
You must be signed in to change notification settings - Fork 158
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 draw.aaline width argument #3140
Conversation
Added to code examples Added to documentation
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.
LGTM, big thanks for this work!
It will just need a little update with upstream and test fixes.
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.
Actually I forgot something important, the final step is also to add new unittests.
well also perhaps it'd be nice if there weren't 15 failed checks lmao |
Judging by how much line got updated/added, I'm moving this PR to 2.5.2 milestone. |
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.
LGTM
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.
Awesome, thank you :) LGTM 👍
Looking forward for aalines, polygon, and aapolygon width enhancements (especially polygon, bro is really ugly at the moment)
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.
OK, LGTM. Line output looks good in local testing and the code makes sense.
👍 🎆 🍾
This PR adds width argument to
draw.aaline
.How it works:
First draw
draw_line_width
(its not antialiased).Calculate its corner points, but slightly move them so relevant antialiased pixels don't overlap with fully opaque pixels.
Then draw 2 thin
draw_aaline
.I made this calculation in separate function
line_width_corners
, because it will be used again when implementing width fordraw.aalines
anddraw.aapolygon
.Sample code