-
-
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 Circle contains()
#2791
Add Circle contains()
#2791
Conversation
Pull main to rerun CI |
Co-authored-by: Emc2356 <[email protected]> Co-authored-by: NovialRiptide <[email protected]> Co-authored-by: ScriptLineStudios <[email protected]> Co-authored-by: Avaxar <[email protected]>
750dd77
to
ca9305d
Compare
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, thanks for the PR 🥳
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 almost looks ready to merge IMO. I just have a few small comments, 3 of which are just for making the tests slightly more robust
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 👍
This PR adds the Circle.contains() method for checking when a shape (Rect/Frect/Circle for now) or point falls completely inside the circle.
I have also made a ltl program to test stuff, feel free to use it as you wish:
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