Advanced checks for openClosedPath extension
This commit is contained in:
parent
67859849e9
commit
48c9a9630e
@ -33,5 +33,11 @@ class OpenClosedPath(inkex.EffectExtension):
|
||||
pp = elem.path.to_absolute() #remove transformation matrix
|
||||
elem.path = re.sub(r"Z","",str(pp))
|
||||
|
||||
sp = elem.path.to_superpath()
|
||||
if sp[0] == sp[-1]: #if first is last point the path is also closed. The "Z" command is not required
|
||||
raw = elem.path.to_arrays()
|
||||
del raw[-1] #delete last point in path
|
||||
elem.path = raw
|
||||
|
||||
if __name__ == '__main__':
|
||||
OpenClosedPath().run()
|
Reference in New Issue
Block a user