From 9c4a982b9a021280ad90e89707eacc1d114e4ac4 Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Tue, 22 Dec 2020 22:57:21 +0100 Subject: [PATCH] Take care of the next letter when A/a is replaced by l Fix #304. --- cairosvg/path.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cairosvg/path.py b/cairosvg/path.py index fe9784fb..6c181c78 100644 --- a/cairosvg/path.py +++ b/cairosvg/path.py @@ -186,7 +186,14 @@ def path(surface, node): # rx=0 or ry=0 means straight line if not rx or not ry: - string = 'l {} {} {}'.format(x3, y3, string) + if string and string[0] not in PATH_LETTERS: + # As we replace the current operation by l, we must be sure + # that the next letter is set to the real current letter (a + # or A) in case it’s omitted + next_letter = '{} '.format(letter) + else: + next_letter = '' + string = 'l {} {} {}{}'.format(x3, y3, next_letter, string) continue radii_ratio = ry / rx