Remove empty m0,0 segments
This commit is contained in:
parent
5f8139a6e3
commit
b68f8483c7
3 changed files with 19 additions and 1 deletions
9
scour.py
9
scour.py
|
|
@ -1670,7 +1670,14 @@ def cleanPath(element, options) :
|
|||
cmd, data = path[pathIndex]
|
||||
i = 0
|
||||
if cmd in ['m','l','t']:
|
||||
if cmd == 'm': i = 2
|
||||
if cmd == 'm':
|
||||
# remove m0,0 segments
|
||||
if data[0] == data[i+1] == 0:
|
||||
# 'm0,0 x,y' can be replaces with 'lx,y'
|
||||
path[pathIndex] = ('l', data[2:])
|
||||
numPathSegmentsReduced += 1
|
||||
else: # else skip move coordinate
|
||||
i = 2
|
||||
while i < len(data):
|
||||
if data[i] == data[i+1] == 0:
|
||||
del data[i:i+2]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue