Skip to content
Open
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
16 changes: 11 additions & 5 deletions aggdraw/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,15 +285,18 @@ def line(self, xy, pen=None):
pen = pen._pen
self._draw.line(xy, pen)

def path(self, xy, path, pen=None, brush=None):
"""Draws a path at the given positions.
def path(self, path, pen=None, brush=None):
"""Draws a path to the surface.

If a brush is given, it is used to fill the path. If a pen is given,
it is used to draw an outline around the path. Either one (or both)
can be left out.

This method draws the path without translation (using the coordinates specified
when defining the :obj:`aggdraw.Path`). To draw a path at a specific location on
the surface, see :meth:`~aggdraw.Draw.symbol`.

Args:
xy: A Python sequence in the format (x, y, x, y, ...)
path (:obj:`aggdraw.Path`): The Path object to draw.
pen (:obj:`aggdraw.Pen`, optional): A pen to use for drawing an outline
around the path.
Expand All @@ -302,7 +305,7 @@ def path(self, xy, path, pen=None, brush=None):

"""
brush, pen = self._parse_args(brush, pen)
self._draw.path(xy, path._path, brush, pen)
self._draw.path(path._path, brush, pen)

def pieslice(self, xy, start, end, pen=None, brush=None):
"""Draws a pie slice.
Expand Down Expand Up @@ -419,9 +422,12 @@ def symbol(self, xy, symbol, pen=None, brush=None):
it is used to draw an outline around the symbol. Either one (or both)
can be left out.

This method can be used to draw both :obj:`aggdraw.Symbol` or
:obj:`aggdraw.Path` objects.

Args:
xy: A Python sequence in the format (x, y, x, y, ...)
symbol (:obj:`aggdraw.Symbol`): The Symbol object to draw.
symbol (:obj:`aggdraw.Symbol`): The Symbol (or Path) object to draw.
pen (:obj:`aggdraw.Pen`, optional): A pen to use for drawing an outline
around the symbol.
brush (:obj:`aggdraw.Brush`, optional): A brush to use for filling
Expand Down
1 change: 1 addition & 0 deletions aggdraw/tests/test_aggdraw.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ def test_path():
draw.line(p)
draw.polygon(p)
draw.symbol((0, 0), p)
draw.path(p)


def test_symbol():
Expand Down
Loading