# HG changeset patch # User Edouard Tisserant # Date 1616663592 -3600 # Node ID 1582753e409bf474a92d06352869da308a9ce7cf # Parent d9c8f8789fc8150f82534ce7273fa5bf34028aa9 SVGHMI: Filter unseen geometry from inkscape CSV output. When inkscape exports geometry form all objects, then it also includes objects from svg:defs. This makes problems when deciding if an object is part of a page, since coordinate of objects in svg:defs can eventualy be contained in a page. In the end, those objects where getting detached when leaving pages where they where found, leading for exemple to non working text on clipping when the clipped text was cloned in multiple page. diff -r d9c8f8789fc8 -r 1582753e409b svghmi/detachable_pages.ysl2 --- a/svghmi/detachable_pages.ysl2 Tue Mar 23 14:09:55 2021 +0100 +++ b/svghmi/detachable_pages.ysl2 Thu Mar 25 10:13:12 2021 +0100 @@ -93,10 +93,7 @@ const "required_list_elements", "func:refered_elements($hmi_lists[@id = $required_page_elements/@id])"; -const "required_elements", - """//svg:defs/descendant-or-self::svg:* - | $required_list_elements - | $required_page_elements"""; +const "required_elements", "$defs | $required_list_elements | $required_page_elements"; const "discardable_elements", "//svg:*[not(@id = $required_elements/@id)]"; diff -r d9c8f8789fc8 -r 1582753e409b svghmi/gen_index_xhtml.xslt --- a/svghmi/gen_index_xhtml.xslt Tue Mar 23 14:09:55 2021 +0100 +++ b/svghmi/gen_index_xhtml.xslt Thu Mar 25 10:13:12 2021 +0100 @@ -303,7 +303,9 @@ - + + + @@ -476,7 +478,7 @@ - + diff -r d9c8f8789fc8 -r 1582753e409b svghmi/geometry.ysl2 --- a/svghmi/geometry.ysl2 Tue Mar 23 14:09:55 2021 +0100 +++ b/svghmi/geometry.ysl2 Thu Mar 25 10:13:12 2021 +0100 @@ -5,7 +5,9 @@ // This retrieves geometry obtained through "inkscape -S" // already parsed by python and presented as a list of // -const "geometry", "ns:GetSVGGeometry()"; +const "all_geometry", "ns:GetSVGGeometry()"; +const "defs", "//svg:defs/descendant-or-self::svg:*"; +const "geometry", "$all_geometry[not(@Id = $defs/@id)]"; // Debug data emit "debug:geometry" {