svghmi/gen_index_xhtml.xslt
branchsvghmi
changeset 3151 8e5d383a58cb
parent 3150 5a1bb6ec48a0
child 3154 a8c81a080588
--- a/svghmi/gen_index_xhtml.xslt	Thu Feb 18 10:43:10 2021 +0100
+++ b/svghmi/gen_index_xhtml.xslt	Thu Feb 18 12:02:28 2021 +0100
@@ -5733,9 +5733,9 @@
 </xsl:text>
     <xsl:text>        let maxh = this.range_elt.height.baseVal.value;
 </xsl:text>
-    <xsl:text>        let pixels = (range - size) * maxh;
-</xsl:text>
-    <xsl:text>        let units = range*range;
+    <xsl:text>        let pixels = maxh;
+</xsl:text>
+    <xsl:text>        let units = range;
 </xsl:text>
     <xsl:text>        return [size, maxh, range, pixels, units];
 </xsl:text>
@@ -5753,7 +5753,7 @@
 </xsl:text>
     <xsl:text>
 </xsl:text>
-    <xsl:text>        let new_y = this.range_elt.y.baseVal.value + Math.round(Math.min(this.position,range) * pixels / units);
+    <xsl:text>        let new_y = this.range_elt.y.baseVal.value + Math.round(Math.min(this.position,range-size) * pixels / units);
 </xsl:text>
     <xsl:text>        let new_height = Math.round(maxh * size/range);
 </xsl:text>
@@ -5783,7 +5783,7 @@
 </xsl:text>
     <xsl:text>    apply_position(position){
 </xsl:text>
-    <xsl:text>        this.position = Math.round(Math.max(Math.min(position, this.range), 0));
+    <xsl:text>        this.position = Math.round(Math.max(Math.min(position, this.range - this.size), 0));
 </xsl:text>
     <xsl:text>        this.apply_hmi_value(0, this.position);
 </xsl:text>