diff options
author | linhsu0723 <linhsu0723> | 2022-10-06 12:13:06 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2022-10-06 12:26:07 +0300 |
commit | eb09be71a96c4fe910fdc43373be5ec08b419d2c (patch) | |
tree | 7bbc40221798aa996ebf2c604d266365ef700f75 | |
parent | c71c092b75ef801bc94fd84be2bc14847dcc8857 (diff) |
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
-rw-r--r-- | io_curve_svg/import_svg.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/io_curve_svg/import_svg.py b/io_curve_svg/import_svg.py index 28f40764..e84c9949 100644 --- a/io_curve_svg/import_svg.py +++ b/io_curve_svg/import_svg.py @@ -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): """ |