Skip to content

Commit

Permalink
Take care of the next letter when A/a is replaced by l
Browse files Browse the repository at this point in the history
Fix #304.
  • Loading branch information
liZe committed Dec 22, 2020
1 parent f0edc6e commit 9c4a982
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cairosvg/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9c4a982

Please sign in to comment.