From f782b628ff55f755ba65e2b23f72f78ff5a5122f Mon Sep 17 00:00:00 2001 From: derVedro Date: Sun, 9 Oct 2016 07:45:42 +0200 Subject: [PATCH] check for necessity of line on closing command --- svgpathtools/parser.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/svgpathtools/parser.py b/svgpathtools/parser.py index 3925fb6..66147b8 100644 --- a/svgpathtools/parser.py +++ b/svgpathtools/parser.py @@ -76,7 +76,8 @@ def parse_path(pathdef, current_pos=0j): elif command == 'Z': # Close path - segments.append(Line(current_pos, start_pos)) + if not (current_pos == start_pos): + segments.append(Line(current_pos, start_pos)) segments.closed = True current_pos = start_pos start_pos = None