Fix (partial) T92713: SVG importer: Ensure path closed before MoveTo
This can fix some broken paths in T92713, like the following PeerTube icon. | before | now | {F13615071} | {F13615072} But some icons are still incomplete due to other issues. Differential Revision: https://developer.blender.org/D16143
This commit is contained in:
parent
c71c092b75
commit
eb09be71a9
|
@ -884,14 +884,17 @@ class SVGPathParser:
|
|||
if cmd is None:
|
||||
raise Exception('Unknown path command: {0}' . format(code))
|
||||
|
||||
if cmd in {'Z', 'z'}:
|
||||
if code in {'Z', 'z'}:
|
||||
closed = True
|
||||
else:
|
||||
closed = False
|
||||
|
||||
if code in {'M', 'm'} and self._use_fill and not closed:
|
||||
self._pathClose('z') # Ensure closed before MoveTo path command
|
||||
|
||||
cmd(code)
|
||||
if self._use_fill and not closed:
|
||||
self._pathClose('z')
|
||||
self._pathClose('z') # Ensure closed at the end of parsing
|
||||
|
||||
def getSplines(self):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue