Skip to content

allow stroke parameter for Circle() #15

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 2 commits into from
Jul 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
13 changes: 11 additions & 2 deletions adafruit_display_shapes/circle.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@


class Circle(RoundRect):
# pylint: disable=too-few-public-methods, invalid-name
"""A circle.

:param x0: The x-position of the center.
Expand All @@ -54,10 +55,18 @@ class Circle(RoundRect):
``None`` for transparent.
:param outline: The outline of the rounded-corner rectangle. Can be a hex value for a color or
``None`` for no outline.
:param stroke: Used for the outline. Will not change the radius.

"""

def __init__(self, x0, y0, r, *, fill=None, outline=None):
def __init__(self, x0, y0, r, *, fill=None, outline=None, stroke=1):
super().__init__(
x0 - r, y0 - r, 2 * r + 1, 2 * r + 1, r, fill=fill, outline=outline
x0 - r,
y0 - r,
2 * r + 1,
2 * r + 1,
r,
fill=fill,
outline=outline,
stroke=stroke,
)
2 changes: 1 addition & 1 deletion adafruit_display_shapes/line.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@


class Line(Polygon):
# pylint: disable=too-many-arguments,invalid-name
# pylint: disable=too-many-arguments,invalid-name, too-few-public-methods
"""A line.

:param x0: The x-position of the first vertex.
Expand Down