SVGHMI fix logic for page membership detection svghmi
authorEdouard Tisserant
Thu, 10 Oct 2019 10:03:47 +0200
branchsvghmi
changeset 2796 c7a22ce8c156
parent 2795 c0cf62bb9aa7
child 2797 c5ba1e77f054
SVGHMI fix logic for page membership detection
svghmi/gen_index_xhtml.xslt
svghmi/gen_index_xhtml.ysl2
--- a/svghmi/gen_index_xhtml.xslt	Thu Oct 10 09:54:44 2019 +0200
+++ b/svghmi/gen_index_xhtml.xslt	Thu Oct 10 10:03:47 2019 +0200
@@ -236,7 +236,7 @@
 </xsl:text>
       <xsl:variable name="page" select="."/>
       <xsl:variable name="p" select="$hmi_geometry[@Id = $page/@id]"/>
-      <xsl:for-each select="$hmi_geometry[@Id != $page/@id and &#10;                       @x &gt;= $p/@x and @y &gt;= $p/@y and &#10;                       @w &lt;= $p/@w and @h &lt;= $p/@h]">
+      <xsl:for-each select="$hmi_geometry[@Id != $page/@id and &#10;                       @x &gt;= $p/@x and @y &gt;= $p/@y and &#10;                       @x+@w &lt;= $p/@x+$p/@w and @y+@h &lt;= $p/@y+$p/@h]">
         <xsl:text>            "</xsl:text>
         <xsl:value-of select="@Id"/>
         <xsl:text>"</xsl:text>
--- a/svghmi/gen_index_xhtml.ysl2	Thu Oct 10 09:54:44 2019 +0200
+++ b/svghmi/gen_index_xhtml.ysl2	Thu Oct 10 10:03:47 2019 +0200
@@ -218,7 +218,7 @@
             const "p", "$hmi_geometry[@Id = $page/@id]"; 
             foreach """$hmi_geometry[@Id != $page/@id and 
                        @x >= $p/@x and @y >= $p/@y and 
-                       @w <= $p/@w and @h <= $p/@h]""" {
+                       @x+@w <= $p/@x+$p/@w and @y+@h <= $p/@y+$p/@h]""" {
                 |             "«@Id»"`if "position()!=last()" > ,`
             }
             |         ]