bugfix in join paths

This commit is contained in:
Mario Voigt 2021-10-18 17:26:22 +02:00
parent f55b36b8a6
commit f0afc55363

View File

@ -74,6 +74,9 @@ def getArrangedIds(pathMap, startPathId):
minDist = 9e+100 #A large float minDist = 9e+100 #A large float
closestId = None closestId = None
np = pathMap[nextPathId] np = pathMap[nextPathId]
if np[-1] == []:
inkex.utils.debug("Warning. Selection seems to contain invalid paths, e.g. pointy paths like M 54,54 Z. Please check and try again!")
exit(1)
npPts = [np[-1][-1][-1]] npPts = [np[-1][-1][-1]]
if(len(orderPathIds) == 1):#compare both the ends for the first path if(len(orderPathIds) == 1):#compare both the ends for the first path
npPts.append(np[0][0][0]) npPts.append(np[0][0][0])
@ -148,7 +151,7 @@ class JoinPaths(inkex.EffectExtension):
self.msg('Please select some paths first.') self.msg('Please select some paths first.')
return return
pathNodes = self.document.xpath('//svg:path',namespaces=inkex.NSS) pathNodes = self.document.xpath('//svg:path',namespaces=inkex.NSS)
paths = {p.get('id'): getPartsFromCubicSuper(CubicSuperPath(p.get('d'))) for p in pathNodes } paths = {p.get('id'): getPartsFromCubicSuper(CubicSuperPath(p.get('d'))) for p in pathNodes }
#paths.keys() Order disturbed #paths.keys() Order disturbed
pathIds = [p.get('id') for p in pathNodes] pathIds = [p.get('id') for p in pathNodes]