Path: Fix for optimizeLinearSegments

Reduce cumulative error by holding onto the original point in a sequence
of linear optimizations. In testing, this fixes artifacts I have seen on
very finely sampled paths with very gradual curvature.

Further improvements are needed for this optimization, but at least this
change avoids a regression over the status quo.
This commit is contained in:
Gabriel Wicke
2020-06-07 15:59:51 -07:00
parent 74bdc701a9
commit 191e5532a8

View File

@@ -2093,7 +2093,7 @@ class ObjectSurface(PathOp.ObjectOp):
for nxt in line[2:]:
if not pnt.isOnLineSegment(prv, nxt):
pts.append(pnt)
prv = pnt
prv = pnt
pnt = nxt
pts.append(line[-1])
return pts