-
-
Notifications
You must be signed in to change notification settings - Fork 115
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
draw.aacircle() #2800
draw.aacircle() #2800
Conversation
…draw.circle() - Added algorithms for drawing thin and thick antialiased circles, adapted from: https://cgg.mff.cuni.cz/~pepca/ref/WU.pdf - Added to documentation - Added to code_examples - Added to tests
Looks like you need to run |
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.
Just a few comments, looking good so far!
def aacircle( | ||
surface: Surface, | ||
color: ColorValue, | ||
center: Coordinate, | ||
radius: float, | ||
width: int = 0, | ||
draw_top_right: bool = False, | ||
draw_top_left: bool = False, | ||
draw_bottom_left: bool = False, | ||
draw_bottom_right: bool = False, | ||
) -> Rect: ... |
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.
I think it would actually be better to have two signatures here. One without the bools, and one with
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.
Why? circle above just has one signature.
- Run `python setup.py format` - Added another signature to buildconfig/stubs/pygame/draw.pyi - Removed unnecesary doubles - Renamed eight_pixels function - Post-increment -> pre-increment - Renamed method names and the docstrings to use aacircle Note: `python setup.py format` formatted some other files I havent touched.
fixed pre-increment added @overload to stubs
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.
I got a couple small comments, but this looks good!
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.
This looks really good to me! 👍
Will enable us to shim the old gfxdraw version completely at some point and has features on top of that that make it consistent with draw.circle.
No notes! 🥇
Pygame-ce has only
gfxdraw.aacircle
function for drawing antialiased circles, but it has several problems:Related issue: Add line thickness in gfxdraw #2463
Related issue: gfxdraw.aacircle weird lines when large radius #2450
and it is intended to be deprecated/removed in future.
All these problems are fixed in
draw.aacircle
, that is implemented in this commit.Changes:
draw.aacircle
function that has same inputs and outputs asdraw.circle
https://cgg.mff.cuni.cz/~pepca/ref/WU.pdf