# HG changeset patch
# User Edouard Tisserant
# Date 1589471360 -7200
# Node ID 88988edb2e93ce7db7ca2174695b32b4a1ab7ba9
# Parent 556ef07a7e31829712bb9afd8f4480325870ef3d
SVGHMI: Switch widget was picking sub-elements from original SVG, not the result SVG ehwe clones are unlinked, thus making problems with svg:use based widgets.
diff -r 556ef07a7e31 -r 88988edb2e93 svghmi/gen_index_xhtml.xslt
--- a/svghmi/gen_index_xhtml.xslt Thu May 14 17:48:58 2020 +0200
+++ b/svghmi/gen_index_xhtml.xslt Thu May 14 17:49:20 2020 +0200
@@ -658,7 +658,7 @@
All units must be set to "px" in Inkscape's document properties
-
+
@@ -689,17 +689,59 @@
+
+
+ transform
+
+
+ style
+
+
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+ ;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1117,10 +1159,6 @@
init() {
- // TODO : use attributes to allow interaction through svg:use
-
- // TODO : deal with dragging
-
this.element.addEventListener(
"mousedown",
@@ -2629,7 +2667,7 @@
choices: [
-
+
{
diff -r 556ef07a7e31 -r 88988edb2e93 svghmi/widget_switch.ysl2
--- a/svghmi/widget_switch.ysl2 Thu May 14 17:48:58 2020 +0200
+++ b/svghmi/widget_switch.ysl2 Thu May 14 17:49:20 2020 +0200
@@ -20,7 +20,7 @@
param "hmi_element";
| choices: [
const "regex",!"'^(\"[^\"].*\"|\-?[0-9]+|false|true)(#.*)?$'"!;
- foreach "$hmi_element/*[regexp:test(@inkscape:label,$regex)]" {
+ foreach "$result_svg_ns//*[@id = $hmi_element/@id]//*[regexp:test(@inkscape:label,$regex)]" {
const "literal", "regexp:match(@inkscape:label,$regex)[2]";
| {
| elt:id("«@id»"),