diff options
| author | Viatrix | 2026-03-30 09:34:13 -0700 |
|---|---|---|
| committer | Viatrix | 2026-03-30 09:34:13 -0700 |
| commit | e5658354e5a3cf43aa1f96e97b9d3f4afc28e38a (patch) | |
| tree | 23faad104cd117db5fb7e063939b0e0b787de67f | |
| parent | dfe3e6410b3592744a3041e2d90ce856e1c592c6 (diff) | |
Removed some unnecessary commands
Turns out selection-restore-backup works by ID.
| -rw-r--r-- | imagemap.py | 2 |
1 files changed, 1 insertions, 1 deletions
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) |
