[cu2qu.ufo] Simplify logic

This commit is contained in:
Behdad Esfahbod 2023-02-22 10:09:12 -07:00
parent 690ffca963
commit 52a8e3b1a4

View File

@ -155,10 +155,10 @@ def _segments_to_quadratic(segments, max_err, stats, all_quadratic=True):
spline_length = str(n - 2)
stats[spline_length] = stats.get(spline_length, 0) + 1
if all_quadratic:
if all_quadratic or n == 3:
return [("qcurve", p) for p in new_points]
else:
return [("qcurve" if len(p) == 3 else "curve", p) for p in new_points]
return [("curve", p) for p in new_points]
def _glyphs_to_quadratic(glyphs, max_err, reverse_direction, stats, all_quadratic=True):