# HG changeset patch
# User Edouard Tisserant
# Date 1581672550 -3600
# Node ID 53d9eb6a74988cd091691ed7e4861b3983943f5c
# Parent ce6cecdb7320a844e3d4ad9b46580c91909169eb
SVGHMI: ensure that coordinate in CSV file generated by inkscape are both matching svg default unit and in default reference frame
diff -r ce6cecdb7320 -r 53d9eb6a7498 svghmi/gen_index_xhtml.xslt
--- a/svghmi/gen_index_xhtml.xslt Thu Feb 13 09:43:35 2020 +0100
+++ b/svghmi/gen_index_xhtml.xslt Fri Feb 14 10:29:10 2020 +0100
@@ -116,6 +116,16 @@
+
+
+ Scale other than 1.000 in Inkscape's document properties is not supported
+
+
+
+
+ All units must be set to "px" in Inkscape's document properties
+
+
Made with SVGHMI. https://beremiz.org
diff -r ce6cecdb7320 -r 53d9eb6a7498 svghmi/gen_index_xhtml.ysl2
--- a/svghmi/gen_index_xhtml.ysl2 Thu Feb 13 09:43:35 2020 +0100
+++ b/svghmi/gen_index_xhtml.ysl2 Fri Feb 14 10:29:10 2020 +0100
@@ -121,6 +121,14 @@
attrib "width" > 100vw
apply "@* | node()", mode="inline_svg";
}
+ /* ensure that coordinate in CSV file generated by inkscape are in default reference frame */
+ template "svg:svg[@viewBox!=concat('0 0 ', @width, ' ', @height)]", mode="inline_svg" {
+ error > ViewBox settings other than X=0, Y=0 and Scale=1 are not supported
+ }
+ /* ensure that coordinate in CSV file generated by inkscape match svg default unit */
+ template "sodipodi:namedview[@units!='px' or @inkscape:document-units!='px']", mode="inline_svg" {
+ error > All units must be set to "px" in Inkscape's document properties
+ }
/*const "mark" > =HMI=\n*/