diff --git a/unittests/Tree_of_life_SVG.svg b/fulltests/Tree_of_Life_SVG.svg similarity index 100% rename from unittests/Tree_of_life_SVG.svg rename to fulltests/Tree_of_Life_SVG.svg diff --git a/scour.py b/scour.py index c7d70db..a8932a5 100755 --- a/scour.py +++ b/scour.py @@ -1672,8 +1672,9 @@ def cleanPath(element, options) : if cmd in ['m','l','t']: if cmd == 'm': # remove m0,0 segments - if data[0] == data[i+1] == 0: - # 'm0,0 x,y' can be replaces with 'lx,y' + if pathIndex > 0 and data[0] == data[i+1] == 0: + # 'm0,0 x,y' can be replaces with 'lx,y', + # except the first m which is a required absolute moveto path[pathIndex] = ('l', data[2:]) numPathSegmentsReduced += 1 else: # else skip move coordinate @@ -1736,7 +1737,7 @@ def cleanPath(element, options) : foundStraightCurve = True else: m = dy/dx - if p1y == m*p1x and p2y == m*p2y: + if p1y == m*p1x and p2y == m*p2x: foundStraightCurve = True if foundStraightCurve: