Skip to content

Commit ea0faca

Browse files
authored
Merge pull request #15 from FoamyGuy/support_stroke_on_circle
allow stroke parameter for Circle()
2 parents 6b64c9f + 17858d0 commit ea0faca

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

adafruit_display_shapes/circle.py

+11-2
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545

4646

4747
class Circle(RoundRect):
48+
# pylint: disable=too-few-public-methods, invalid-name
4849
"""A circle.
4950
5051
:param x0: The x-position of the center.
@@ -54,10 +55,18 @@ class Circle(RoundRect):
5455
``None`` for transparent.
5556
:param outline: The outline of the rounded-corner rectangle. Can be a hex value for a color or
5657
``None`` for no outline.
58+
:param stroke: Used for the outline. Will not change the radius.
5759
5860
"""
5961

60-
def __init__(self, x0, y0, r, *, fill=None, outline=None):
62+
def __init__(self, x0, y0, r, *, fill=None, outline=None, stroke=1):
6163
super().__init__(
62-
x0 - r, y0 - r, 2 * r + 1, 2 * r + 1, r, fill=fill, outline=outline
64+
x0 - r,
65+
y0 - r,
66+
2 * r + 1,
67+
2 * r + 1,
68+
r,
69+
fill=fill,
70+
outline=outline,
71+
stroke=stroke,
6372
)

adafruit_display_shapes/line.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646

4747
class Line(Polygon):
48-
# pylint: disable=too-many-arguments,invalid-name
48+
# pylint: disable=too-many-arguments,invalid-name, too-few-public-methods
4949
"""A line.
5050
5151
:param x0: The x-position of the first vertex.

0 commit comments

Comments
 (0)