[qu2cuPen] Don't add implicit points for cubics

We can't since that would be interpretted as a superBezier.
This commit is contained in:
Behdad Esfahbod 2023-02-17 15:47:46 -07:00
parent 86aff322b9
commit 84cd10d666

View File

@ -78,12 +78,14 @@ class Qu2CuPen(ContourFilterPen):
contour = newContour
newContour = []
for op, args in contour:
if (op in {"curveTo", "qCurveTo"} and newContour and newContour[-1][0] == op):
if op == "qCurveTo" and newContour and newContour[-1][0] == "qCurveTo":
pt0 = newContour[-1][1][-2]
pt1 = newContour[-1][1][-1]
pt2 = args[0]
if (pt2[0] - pt1[0] == pt1[0] - pt0[0] and
pt2[1] - pt1[1] == pt1[1] - pt0[1]):
if (
pt2[0] - pt1[0] == pt1[0] - pt0[0]
and pt2[1] - pt1[1] == pt1[1] - pt0[1]
):
newArgs = newContour[-1][1][:-1] + args
newContour[-1] = (op, newArgs)
continue