aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViatrix2026-05-05 12:42:08 -0700
committerViatrix2026-05-05 12:42:08 -0700
commit30576dcc3b88d99f7b0aa48e27b418d7777cabf8 (patch)
tree915a64043004b2cc28315d7f4a8cec27faa09170
parent1d393aa4c1e6f245394ebeab933a0137516c13a8 (diff)
Added second selection-ungroup, for stroked & filled tspans.HEADmain
-rw-r--r--imagemap.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/imagemap.py b/imagemap.py
index 483845b..0a1c12a 100644
--- a/imagemap.py
+++ b/imagemap.py
@@ -125,8 +125,8 @@ class ImageMap(inkex.OutputExtension):
command=\
''.join(f'select-clear;select-by-id:{i};selection-ungroup;' for i in reversed(svgIDs)) \
+''.join(f'select-clear;select-by-id:{i[0]};{"selection-ungroup;"*i[1]}' for i in reversed(clipped) if i[1]>0) \
- +''.join(f'select-clear;select-by-id:{i[0]};object-release-clip;selection-set-backup;select-clear;select-by-id:{i[0]};object-stroke-to-path;selection-ungroup;path-union;object-set-attribute:id,{i[0]};selection-restore-backup;path-intersection;object-set-attribute:style,{CSS_LINK_INDEX}:{i[1]};' for i in clippedpaths) \
- +''.join(f'select-clear;select-by-selector:[style~="{CSS_LINK_INDEX}-{i}"];object-stroke-to-path;selection-ungroup;path-union;select-by-id:{rects[i]};path-intersection;object-set-attribute:style,{CSS_LINK_INDEX}:" {CSS_LINK_INDEX}-{i} ";' for i in range(len(links))) \
+ +''.join(f'select-clear;select-by-id:{i[0]};object-release-clip;selection-set-backup;select-clear;select-by-id:{i[0]};object-stroke-to-path;selection-ungroup;selection-ungroup;path-union;object-set-attribute:id,{i[0]};selection-restore-backup;path-intersection;object-set-attribute:style,{CSS_LINK_INDEX}:{i[1]};' for i in clippedpaths) \
+ +''.join(f'select-clear;select-by-selector:[style~="{CSS_LINK_INDEX}-{i}"];object-stroke-to-path;selection-ungroup;selection-ungroup;path-union;select-by-id:{rects[i]};path-intersection;object-set-attribute:style,{CSS_LINK_INDEX}:" {CSS_LINK_INDEX}-{i} ";' for i in range(len(links))) \
+'select-all;path-flatten;path-split'
# (we re-set the existing style attribute in case it got unset on non-paths)
newbytes=inkscape_command(self.svg,actions=command)