Skip to content

Commit 9c4a982

Browse files
committed
Take care of the next letter when A/a is replaced by l
Fix #304.
1 parent f0edc6e commit 9c4a982

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

cairosvg/path.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,14 @@ def path(surface, node):
186186

187187
# rx=0 or ry=0 means straight line
188188
if not rx or not ry:
189-
string = 'l {} {} {}'.format(x3, y3, string)
189+
if string and string[0] not in PATH_LETTERS:
190+
# As we replace the current operation by l, we must be sure
191+
# that the next letter is set to the real current letter (a
192+
# or A) in case it’s omitted
193+
next_letter = '{} '.format(letter)
194+
else:
195+
next_letter = ''
196+
string = 'l {} {} {}{}'.format(x3, y3, next_letter, string)
190197
continue
191198

192199
radii_ratio = ry / rx

0 commit comments

Comments
 (0)