-
-
Notifications
You must be signed in to change notification settings - Fork 117
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 Circle move()
/move_ip()
#2561
Add Circle move()
/move_ip()
#2561
Conversation
Co-authored-by: Emc2356 <63981925+emc2356@users.noreply.github.com> Co-authored-by: NovialRiptide <35881688+novialriptide@users.noreply.github.com> Co-authored-by: ScriptLineStudios <scriptlinestudios@protonmail.com> Co-authored-by: Avaxar <44055981+avaxar@users.noreply.github.com> Co-authored-by: maqa41 <amehebbet41@gmail.com>
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.
looks like this PR has conflicts now
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.
Left another nitpick about richcompare, though I'm happy with move[_ip]
so I will go ahead and approve this, thanks for the PR 🎉
src_c/circle.c
Outdated
{ | ||
pgCircleBase c1, c2; | ||
if (!pgCircle_FromObject(self, &c1) || !pgCircle_FromObject(other, &c2)) { | ||
Py_RETURN_NOTIMPLEMENTED; |
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.
The general python convention for implementing comparison of non-matching types is:
==
should be False
, !=
should be True
and all other operations should raise the not implemented error
I know pygame doesn't stick to this convention in a lot of places, but we can certainly consider this for new code
This PR adds the move/move_ip functions to the Circle object. It also adds the possibility of doing equality/inequality checks and an internal function for creating circle objects starting from three values.
Credits
Geometry Project:
For code, docs and tests:
@novialriptide @Emc2356 @itzpr3d4t0r @ScriptLineStudios @avaxar @Matiiss @newpaxonian @maqa41 @blankRiot96
Also thanks to @Starbuck5 for kickstarting the idea and the occasional help!
Functionality added in this PR
circle.c
https://github.com/pygame-community/pygame-geometry/blame/main/src_c/circle.c
Credits to @Emc2356 @itzpr3d4t0r @novialriptide
geometry.pyi
https://github.com/pygame-community/pygame-geometry/blame/main/geometry.pyi
Credits to @Emc2356 @itzpr3d4t0r @novialriptide @ScriptLineStudios @avaxar
geometry_test.py
https://github.com/pygame-community/pygame-geometry/blame/main/test/test_circle.py
Credits to @itzpr3d4t0r @novialriptide
geometry.rst
https://github.com/pygame-community/pygame-geometry/blame/main/docs/circle.rst
Credits to @itzpr3d4t0r