Index: sources/gui/qml/components/Slider.qml =================================================================== diff -u -rc9f8f8cf3c6c37fc6460d8675c62c9442c4d4263 -r1f2e7dbd08b00f8c56eedf29f083733570aa642e --- sources/gui/qml/components/Slider.qml (.../Slider.qml) (revision c9f8f8cf3c6c37fc6460d8675c62c9442c4d4263) +++ sources/gui/qml/components/Slider.qml (.../Slider.qml) (revision 1f2e7dbd08b00f8c56eedf29f083733570aa642e) @@ -82,12 +82,10 @@ // real-time bound change should effect the current set value onMinimumChanged: { - minimum = minimum.toFixed(decimal) if (value < minimum ) value = minimum } onMaximumChanged: { - maximum = maximum.toFixed(decimal) if (value > maximum ) value = maximum } @@ -115,24 +113,28 @@ function setValue(x) { let mValue = 0 - if ( x < 0 ) { mValue = minimum; update(mValue); return; } - if ( x > width ) { mValue = maximum; update(mValue); return; } + let mMinimum = Number(_root.minimum.toFixed(decimal)) + let mMaximum = Number(_root.maximum.toFixed(decimal)) + if ( x < 0 ) { mValue = mMinimum; update(mValue); return; } + if ( x > width ) { mValue = mMaximum; update(mValue); return; } mValue = getValueOfX(x) - if ( step === 1 ) { mValue = parseInt(mValue); update(mValue); return; } + if ( step === 1 ) { mValue = parseInt(mValue); update(mValue); return; } let start = 0 - if ( ! stepSnap ) start = minimum + if ( ! stepSnap ) start = mMinimum mValue = Math.round((mValue - start) / step) * step + start let decimals = Math.round(-Math.log10(step)) - if (decimals > 0) mValue = mValue.toFixed(decimals) + if (decimals > 0) { + mValue = mValue.toFixed(decimals) + } - if ( mValue < minimum ) { mValue = minimum; update(mValue); return; } - if ( mValue > maximum ) { mValue = maximum; update(mValue); return; } + if ( mValue < mMinimum ) { mValue = mMinimum; update(mValue); return; } + if ( mValue > mMaximum ) { mValue = mMaximum; update(mValue); return; } - update(mValue); return; + update(mValue); return; } function setHandlerPosition() {