diff -r 5a1bb6ec48a0 -r 8e5d383a58cb svghmi/gen_index_xhtml.xslt --- 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 @@ let maxh = this.range_elt.height.baseVal.value; - let pixels = (range - size) * maxh; - - let units = range*range; + let pixels = maxh; + + let units = range; return [size, maxh, range, pixels, units]; @@ -5753,7 +5753,7 @@ - let new_y = this.range_elt.y.baseVal.value + Math.round(Math.min(this.position,range) * pixels / units); + let new_y = this.range_elt.y.baseVal.value + Math.round(Math.min(this.position,range-size) * pixels / units); let new_height = Math.round(maxh * size/range); @@ -5783,7 +5783,7 @@ apply_position(position){ - this.position = Math.round(Math.max(Math.min(position, this.range), 0)); + this.position = Math.round(Math.max(Math.min(position, this.range - this.size), 0)); this.apply_hmi_value(0, this.position);