From 5aca421003b008e116c170d6be789ac28e602cf7 Mon Sep 17 00:00:00 2001 From: Viatrix Date: Thu, 12 Mar 2026 14:53:01 -0700 Subject: Images with dummy fill and stroke handled correctly. --- imagemap.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'imagemap.py') diff --git a/imagemap.py b/imagemap.py index 3d25403..8ab6558 100644 --- a/imagemap.py +++ b/imagemap.py @@ -62,10 +62,12 @@ class ImageMap(inkex.OutputExtension): link={attr:AREA_ATTRS[attr](a) for attr in AREA_ATTRS.keys()} for el in a.iterdescendants(): # CSS is preserved when flattening (for paths) if not isinstance(el,inkex.ShapeElement): continue - if el.tag=='{http://www.w3.org/2000/svg}image': - el.tag='{http://www.w3.org/2000/svg}rect' # because flattening an image creates a clip-path style=el.effective_style() style[CSS_LINK_INDEX]=f'" {CSS_LINK_INDEX}-{len(links)} "' + if el.tag=='{http://www.w3.org/2000/svg}image': + el.tag='{http://www.w3.org/2000/svg}rect' # because flattening an image creates a clip-path + style['stroke']='none' + style['fill']='#000' links += [link] if len(links)==0: raise inkex.AbortExtension(_("Image has no hyperlinks.\nAdd a hyperlink to an object with right-click → \"{}\".").format(_("Create Anchor (Hyperlink)"))) -- cgit