Index: sources/gui/qml/components/Slider.qml =================================================================== diff -u -r261fa5939140953733f764f2c783c35347de415f -r54b940806bb1acdbdeef6ff7b61cd13418d578e7 --- sources/gui/qml/components/Slider.qml (.../Slider.qml) (revision 261fa5939140953733f764f2c783c35347de415f) +++ sources/gui/qml/components/Slider.qml (.../Slider.qml) (revision 54b940806bb1acdbdeef6ff7b61cd13418d578e7) @@ -188,6 +188,12 @@ return (Math.round(vValue / step) * step).toFixed(decimal) } + // round the value based on the given precision (not step) + function calculatePrecisionRoundedValue(value) { + let multiplier = Math.pow(10, decimal) + return Math.round(value * multiplier) / multiplier + } + function getValueOfX(x) { return ( x * ( maximum - minimum ) ) / width + minimum } @@ -198,7 +204,7 @@ function calculateValue(x, isSnappingToTicks) { let mMinimum = calculateMinimum() - let mMaximum = calculateRoundedValue(_root.maximum) + let mMaximum = calculatePrecisionRoundedValue(_root.maximum) // the center of the handler is aligned on the snap point and half width shall be used to set as min not the entire width. // also half of the hadler is out of slider min position when set on min, which proves the same as above. @@ -258,12 +264,12 @@ */ function calculateMinimum() { let result = calculateRoundedValue(_root.minimum) - let rdMinStop = calculateRoundedValue(_root.minStop) + let rdMinStop = calculatePrecisionRoundedValue(_root.minStop) if (rdMinStop > result) { if (stepSnap) { // if slider is set to snap and minimum stop is not on a step, then // adjust it to one step above - let rdStep = calculateRoundedValue(step) + let rdStep = calculatePrecisionRoundedValue(step) result = Math.ceil(rdMinStop/rdStep) * rdStep } else {