small fixes

This commit is contained in:
Mario Voigt 2021-10-17 23:35:43 +02:00
parent 0d91114305
commit 40ee4be1fe
3 changed files with 16 additions and 7 deletions

View File

@ -111,9 +111,12 @@ class ContourScannerAndTrimmer(inkex.EffectExtension):
csp = CubicSuperPath(subPath)
if len(subPath) > 1 and csp[0][0] != csp[0][1]: #avoids pointy paths like M "31.4794 57.6024 Z"
replacedelement.path = subPath
replacedelement.set('id', oldId + str(idSuffix))
if len(subPaths) == 1:
replacedelement.set('id', oldId)
else:
replacedelement.set('id', oldId + str(idSuffix))
idSuffix += 1
parent.insert(idx, replacedelement)
idSuffix += 1
breakelements.append(replacedelement)
element.delete()
for child in element.getchildren():

View File

@ -83,9 +83,12 @@ class LinksCreator(inkex.EffectExtension):
csp = CubicSuperPath(subpath)
if len(subpath) > 1 and csp[0][0] != csp[0][1]: #avoids pointy paths like M "31.4794 57.6024 Z"
replacedelement.set('d', csp)
replacedelement.set('id', oldId + str(idSuffix))
if len(subPaths) == 1:
replacedelement.set('id', oldId)
else:
replacedelement.set('id', oldId + str(idSuffix))
idSuffix += 1
parent.insert(idx, replacedelement)
idSuffix += 1
breakelements.append(replacedelement)
parent.remove(element)
for child in element.getchildren():

View File

@ -73,9 +73,12 @@ class UnwindPaths(inkex.EffectExtension):
csp = CubicSuperPath(subpath)
if len(subpath) > 1 and csp[0][0] != csp[0][1]: #avoids pointy paths like M "31.4794 57.6024 Z"
replacedelement.set('d', csp)
replacedelement.set('id', oldId + str(idSuffix))
if len(subPaths) == 1:
replacedelement.set('id', oldId)
else:
replacedelement.set('id', oldId + str(idSuffix))
idSuffix += 1
parent.insert(idx, replacedelement)
idSuffix += 1
breakelements.append(replacedelement)
parent.remove(element)
else:
@ -228,7 +231,7 @@ class UnwindPaths(inkex.EffectExtension):
self.drawline(d, "segmented-" + element.get('id'), newOriginalPathGroup, new_original_line_style)
if self.options.keep_original is False:
element.delete()
element.delete()
else:
self.msg('Please select some paths first.')