Skip to content

Circle collidepolygon() and Polygon collidecircle() #189

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

Merged
merged 18 commits into from
Jul 6, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactors
  • Loading branch information
itzpr3d4t0r committed Jan 22, 2023
commit 3e919aaacd28d4f095c60cf38d2eafda38d5c7b2
6 changes: 2 additions & 4 deletions src_c/circle.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,10 +472,8 @@ static PyObject *
pg_circle_collidepolygon(pgCircleObject *self, PyObject *const *args,
Py_ssize_t nargs)
{
int was_sequence, result = 0;
int was_sequence, result = 0, only_edges = 0;
pgPolygonBase poly;
pgCircleBase *scirc = &self->circle;
int only_edges = 0;

/* Check for the optional only_edges argument */
if (args[nargs - 1] == Py_True) {
Expand All @@ -489,7 +487,7 @@ pg_circle_collidepolygon(pgCircleObject *self, PyObject *const *args,
"collidepolygon requires a PolygonType or PolygonLike object");
}

result = pgCollision_CirclePolygon(scirc, &poly, only_edges);
result = pgCollision_CirclePolygon(&self->circle, &poly, only_edges);

PG_FREEPOLY_COND(&poly, was_sequence);

Expand Down