SVGHMI: do not discard out-of-page elements inside widgets that are ovelapping pages.
authorEdouard Tisserant
Wed, 21 Sep 2022 11:41:28 +0200
changeset 3622 98ce26040117
parent 3621 da020d88db0c
child 3623 0237c28cd172
SVGHMI: do not discard out-of-page elements inside widgets that are ovelapping pages.
svghmi/detachable_pages.ysl2
--- a/svghmi/detachable_pages.ysl2	Fri Sep 16 09:03:59 2022 +0200
+++ b/svghmi/detachable_pages.ysl2	Wed Sep 21 11:41:28 2022 +0200
@@ -68,7 +68,11 @@
     param "page";
     const "page_overlapping_geometry", "$overlapping_geometry/elt[@id = $page/@id]/*";
     const "page_overlapping_elements", "//svg:*[@id = $page_overlapping_geometry/@Id]";
-    const "page_sub_elements", "func:refered_elements($page | $page_overlapping_elements)";
+    const "page_widgets_elements", """
+        $hmi_elements[not(@id=$page/@id)
+                      and descendant-or-self::svg:*/@id = $page_overlapping_elements/@id]
+        /descendant-or-self::svg:*""";
+    const "page_sub_elements", "func:refered_elements($page | $page_overlapping_elements | $page_widgets_elements)";
     result "$page_sub_elements";
 }
 
@@ -214,6 +218,10 @@
     foreach "$detachable_elements"{
         |  «@id»
     }
+    | DISCARDABLES:
+    foreach "$discardable_elements"{
+        |  «@id»
+    }
     | In Foreach:
     foreach "$in_forEach_widget_ids"{
         |  «.»