Skip to content

Commit 63ed62d

Browse files
committed
corrected functions signatures and slight changes
1 parent 28168ff commit 63ed62d

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

geometry.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class Line(Sequence[float]):
109109
def collidecircle(self, circle: CircleValue) -> bool: ...
110110
@overload
111111
def collidecircle(self, x: float, y: float, r: float) -> bool: ...
112-
def collidepolygon(self, polygon: Polygon) -> bool: ...
112+
def collidepolygon(self, polygon: Polygon, only_edges: bool = False) -> bool: ...
113113
def as_rect(self) -> Rect: ...
114114
@overload
115115
def move(self, x: float, y: float) -> Line: ...
@@ -215,7 +215,7 @@ class Polygon:
215215
def collidepoint(self, x: float, y: float) -> bool: ...
216216
@overload
217217
def collidepoint(self, point: Coordinate) -> bool: ...
218-
def collideline(self, line: LineValue) -> bool: ...
218+
def collideline(self, line: LineValue, only_edges: bool = False) -> bool: ...
219219
def get_bounding_box(self) -> Rect: ...
220220
def is_convex() -> bool: ...
221221
def insert_vertex(self, index: int, vertex: Coordinate) -> None: ...

src_c/line.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -499,9 +499,7 @@ pg_line_collidepolygon(pgLineObject *self, PyObject *const *args,
499499

500500
/* Check for the optional only_edges argument */
501501
if (PyBool_Check(args[nargs - 1])) {
502-
if (args[nargs - 1] == Py_True) {
503-
only_edges = 1;
504-
}
502+
only_edges = args[nargs - 1] == Py_True;
505503
nargs--;
506504
}
507505

src_c/polygon.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,9 +1143,7 @@ pg_polygon_collideline(pgPolygonObject *self, PyObject *const *args,
11431143

11441144
/* Check for the optional only_edges argument */
11451145
if (PyBool_Check(args[nargs - 1])) {
1146-
if (args[nargs - 1] == Py_True) {
1147-
only_edges = 1;
1148-
}
1146+
only_edges = args[nargs - 1] == Py_True;
11491147
nargs--;
11501148
}
11511149

0 commit comments

Comments
 (0)