Skip to content
Snippets Groups Projects
Commit eb09be71 authored by linhsu0723's avatar linhsu0723 Committed by Sergey Sharybin
Browse files

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
parent c71c092b
No related branches found
No related tags found
No related merge requests found
......@@ -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):
"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment