Apply a fix by Jan Thor to bug 714717, whereby Scour wrongly optimises away "0-length" Bézier curves if they have non-zero control points that actually create a curve.

This commit is contained in:
Louis Simard 2011-02-07 13:48:15 -05:00
parent 6dc2553bed
commit da3c9f1d98

View file

@ -1680,7 +1680,7 @@ def cleanPath(element, options) :
i += 2 i += 2
elif cmd == 'c': elif cmd == 'c':
while i < len(data): while i < len(data):
if data[i+4] == data[i+5] == 0: if data[i] == data[i+1] == data[i+2] == data[i+3] == data[i+4] == data[i+5] == 0:
del data[i:i+6] del data[i:i+6]
numPathSegmentsReduced += 1 numPathSegmentsReduced += 1
else: else:
@ -1694,7 +1694,7 @@ def cleanPath(element, options) :
i += 7 i += 7
elif cmd == 'q': elif cmd == 'q':
while i < len(data): while i < len(data):
if data[i+2] == data[i+3] == 0: if data[i] == data[i+1] == data[i+2] == data[i+3] == 0:
del data[i:i+4] del data[i:i+4]
numPathSegmentsReduced += 1 numPathSegmentsReduced += 1
else: else: