From 318a84508163ad786f12ee72d01b1b15d3295f73 Mon Sep 17 00:00:00 2001 From: Viatrix Date: Thu, 12 Mar 2026 12:57:41 -0700 Subject: Added image test case and adjusted code to pass it. Removed rect test case since it was getting redundant. --- imagemap.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'imagemap.py') diff --git a/imagemap.py b/imagemap.py index 22789f0..89452be 100644 --- a/imagemap.py +++ b/imagemap.py @@ -62,6 +62,8 @@ 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)} "' links += [link] -- cgit