diff --git a/io_curve_svg/import_svg.py b/io_curve_svg/import_svg.py index 4298470bf4eb2b2d83a10f1e2a7e8025ab702a58..6b45d91d057b714a364fd900ab6fde906a36569a 100644 --- a/io_curve_svg/import_svg.py +++ b/io_curve_svg/import_svg.py @@ -666,6 +666,9 @@ class SVGPathParser: if last['handle_right_type'] == 'VECTOR' and handle_left_type == 'FREE': last['handle_right'] = (last['x'], last['y']) last['handle_right_type'] = 'FREE' + if last['handle_right_type'] == 'FREE' and handle_left_type == 'VECTOR': + handle_left = (x, y) + handle_left_type = 'FREE' point = {'x': x, 'y': y, @@ -1230,6 +1233,19 @@ class SVGGeometryPATH(SVGGeometry): for spline in self._splines: act_spline = None + + if spline['closed'] and len(spline['points']) >= 2: + first = spline['points'][0] + last = spline['points'][-1] + if ( first['handle_left_type'] == 'FREE' and + last['handle_right_type'] == 'VECTOR'): + last['handle_right_type'] = 'FREE' + last['handle_right'] = (last['x'], last['y']) + if ( last['handle_right_type'] == 'FREE' and + first['handle_left_type'] == 'VECTOR'): + first['handle_left_type'] = 'FREE' + first['handle_left'] = (first['x'], first['y']) + for point in spline['points']: co = self._transformCoord((point['x'], point['y']))