bugfixing move path node

This commit is contained in:
Mario Voigt 2021-05-30 11:33:19 +02:00
parent 718cdec4b3
commit 9d4c94d4b2
1 changed files with 5 additions and 2 deletions

View File

@ -51,14 +51,17 @@ class MovePathNode(inkex.EffectExtension):
self.msg("{} is not closed! Skipping ...".format(element.get('id')))
continue #skip this open path
if len(path) == 2:
continue #skip this open path (special case of straight line segment)
if path[-1][0] == 'Z': #replace Z with another L command (which moves to the coordinates of the first M command in path) to have better overview
path[-1][0] = 'L'
path[-1][1] = path[0][1]
#adjust if entered move number is higher than actual node count. We handle as infinite looping
moves = (self.options.movenode - 1) % len(path)
moves = (self.options.movenode) % len(path)
if pathIsClosed is True: #if closed start and end collapse and "duplicate"
moves = (self.options.movenode - 1) % (len(path) - 1)
moves = (self.options.movenode) % (len(path) - 1)
if self.options.movenode == 0: #special handling for 0 is required
moves = 0