From e696ddb5b029b19bd3060ab0a054e1bbf467555f Mon Sep 17 00:00:00 2001 From: Austin Hurst Date: Wed, 12 Aug 2026 16:43:07 -0300 Subject: [PATCH 1/3] Fix draw.path and improve documentation --- aggdraw/core.py | 18 ++++++++++++------ aggdraw/tests/test_aggdraw.py | 2 +- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/aggdraw/core.py b/aggdraw/core.py index 07e1d44..3c2ff50 100644 --- a/aggdraw/core.py +++ b/aggdraw/core.py @@ -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. - Args: - xy: A Python sequence in the format (x, y, x, y, ...) + 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 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. @@ -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. @@ -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 diff --git a/aggdraw/tests/test_aggdraw.py b/aggdraw/tests/test_aggdraw.py index a580c3c..6f163d3 100644 --- a/aggdraw/tests/test_aggdraw.py +++ b/aggdraw/tests/test_aggdraw.py @@ -130,7 +130,7 @@ def test_path(): draw.line(p) draw.polygon(p) draw.symbol((0, 0), p) - + draw.path(p) def test_symbol(): from aggdraw import Symbol From 6dd662ccc0eeb22549ee5ceb42031a6e0662bb71 Mon Sep 17 00:00:00 2001 From: Austin Hurst Date: Wed, 12 Aug 2026 16:53:53 -0300 Subject: [PATCH 2/3] Fix spacing --- aggdraw/tests/test_aggdraw.py | 1 + 1 file changed, 1 insertion(+) diff --git a/aggdraw/tests/test_aggdraw.py b/aggdraw/tests/test_aggdraw.py index 6f163d3..a7b6ae8 100644 --- a/aggdraw/tests/test_aggdraw.py +++ b/aggdraw/tests/test_aggdraw.py @@ -132,6 +132,7 @@ def test_path(): draw.symbol((0, 0), p) draw.path(p) + def test_symbol(): from aggdraw import Symbol Symbol("M0,0L0,0L0,0L0,0Z") From 667a3333e1acdd101bed57acde963e6813c30a9b Mon Sep 17 00:00:00 2001 From: Austin Hurst Date: Wed, 12 Aug 2026 18:24:35 -0300 Subject: [PATCH 3/3] Fix accidental docs removal --- aggdraw/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aggdraw/core.py b/aggdraw/core.py index 3c2ff50..381f6cf 100644 --- a/aggdraw/core.py +++ b/aggdraw/core.py @@ -296,7 +296,7 @@ def path(self, path, pen=None, brush=None): when defining the :obj:`aggdraw.Path`). To draw a path at a specific location on the surface, see :meth:`~aggdraw.Draw.symbol`. - Args + Args: 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.