From e5658354e5a3cf43aa1f96e97b9d3f4afc28e38a Mon Sep 17 00:00:00 2001 From: Viatrix Date: Mon, 30 Mar 2026 09:34:13 -0700 Subject: Removed some unnecessary commands Turns out selection-restore-backup works by ID. --- imagemap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imagemap.py b/imagemap.py index 9f801b6..483845b 100644 --- a/imagemap.py +++ b/imagemap.py @@ -125,7 +125,7 @@ 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;unselect-by-id:{i[0]};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;select-by-id:{i[0]};path-intersection;object-set-attribute:style,{CSS_LINK_INDEX}:{i[1]};' for i in clippedpaths) \ + +''.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))) \ +'select-all;path-flatten;path-split' # (we re-set the existing style attribute in case it got unset on non-paths) -- cgit