small fixes
This commit is contained in:
parent
0d91114305
commit
40ee4be1fe
@ -111,9 +111,12 @@ class ContourScannerAndTrimmer(inkex.EffectExtension):
|
|||||||
csp = CubicSuperPath(subPath)
|
csp = CubicSuperPath(subPath)
|
||||||
if len(subPath) > 1 and csp[0][0] != csp[0][1]: #avoids pointy paths like M "31.4794 57.6024 Z"
|
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.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)
|
parent.insert(idx, replacedelement)
|
||||||
idSuffix += 1
|
|
||||||
breakelements.append(replacedelement)
|
breakelements.append(replacedelement)
|
||||||
element.delete()
|
element.delete()
|
||||||
for child in element.getchildren():
|
for child in element.getchildren():
|
||||||
|
@ -83,9 +83,12 @@ class LinksCreator(inkex.EffectExtension):
|
|||||||
csp = CubicSuperPath(subpath)
|
csp = CubicSuperPath(subpath)
|
||||||
if len(subpath) > 1 and csp[0][0] != csp[0][1]: #avoids pointy paths like M "31.4794 57.6024 Z"
|
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('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)
|
parent.insert(idx, replacedelement)
|
||||||
idSuffix += 1
|
|
||||||
breakelements.append(replacedelement)
|
breakelements.append(replacedelement)
|
||||||
parent.remove(element)
|
parent.remove(element)
|
||||||
for child in element.getchildren():
|
for child in element.getchildren():
|
||||||
|
@ -73,9 +73,12 @@ class UnwindPaths(inkex.EffectExtension):
|
|||||||
csp = CubicSuperPath(subpath)
|
csp = CubicSuperPath(subpath)
|
||||||
if len(subpath) > 1 and csp[0][0] != csp[0][1]: #avoids pointy paths like M "31.4794 57.6024 Z"
|
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('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)
|
parent.insert(idx, replacedelement)
|
||||||
idSuffix += 1
|
|
||||||
breakelements.append(replacedelement)
|
breakelements.append(replacedelement)
|
||||||
parent.remove(element)
|
parent.remove(element)
|
||||||
else:
|
else:
|
||||||
@ -228,7 +231,7 @@ class UnwindPaths(inkex.EffectExtension):
|
|||||||
self.drawline(d, "segmented-" + element.get('id'), newOriginalPathGroup, new_original_line_style)
|
self.drawline(d, "segmented-" + element.get('id'), newOriginalPathGroup, new_original_line_style)
|
||||||
|
|
||||||
if self.options.keep_original is False:
|
if self.options.keep_original is False:
|
||||||
element.delete()
|
element.delete()
|
||||||
|
|
||||||
else:
|
else:
|
||||||
self.msg('Please select some paths first.')
|
self.msg('Please select some paths first.')
|
||||||
|
Reference in New Issue
Block a user