This commit is contained in:
Behdad Esfahbod 2023-02-17 15:22:24 -07:00
parent ceae682246
commit ea8ae8f399
2 changed files with 3 additions and 3 deletions

View File

@ -62,8 +62,8 @@ class Qu2CuPen(ContourFilterPen):
quadratics = []
currentPt = None
newContour = []
for op,args in contour:
if op == 'qCurveTo' and len(args) > 2 and args[-1] is not None:
for op, args in contour:
if op == "qCurveTo" and len(args) > 2 and args[-1] is not None:
quadratics.append((currentPt,) + args)
else:
if quadratics:

View File

@ -269,7 +269,7 @@ def spline_to_curves(q, tolerance=0.5, all_cubic=False):
j = 0
for i in reversed(splits):
if not all_cubic and j + 1 == i:
curves.append(q[j:j+3])
curves.append(q[j : j + 3])
else:
curves.append(merge_curves(elevated_quadratics[j:i])[0])
j = i