Index: sources/gui/qml/components/Slider.qml =================================================================== diff -u -r475b176cf3e05488c5c38e0e0e7f1bad1017ed1d -r74de6c3e36568bf842648d1a9f8d5bb6949fca5b --- sources/gui/qml/components/Slider.qml (.../Slider.qml) (revision 475b176cf3e05488c5c38e0e0e7f1bad1017ed1d) +++ sources/gui/qml/components/Slider.qml (.../Slider.qml) (revision 74de6c3e36568bf842648d1a9f8d5bb6949fca5b) @@ -119,7 +119,7 @@ } } - height : Variables.progressbarHeight + height : Variables.sliderDefaultBodyHeight touchMargin : 25 leftRightTouchMargin: _handler.width/2 @@ -163,7 +163,7 @@ } function update(vValue) { - _root.value = Number(vValue).toFixed(decimal) + _root.value = vValue } function calculateValue(x, isSnappingToTicks) { @@ -186,8 +186,6 @@ if ( ! stepSnap ) start = mMinimum - mValue = getValueOfX(x) - // special handling for the case that the step segments are less than the handle's width let stepWidth = width / ((mMaximum - mMinimum) / step) if ( stepWidth < _handler.width ) { @@ -196,18 +194,21 @@ return mValue.toFixed(decimal) } - if ( isSnappingToTicks ) { - mValue = Math.round((mValue - start) / step) * step + start - let additionalDecimalResolution = 3 - mValue = mValue.toFixed(decimal + additionalDecimalResolution) + // calculate the expected value based on x + mValue = getValueOfX(x) - } - // For sliders with decimal min, max, values, we need to add refinement to // the value to achieve slider handle movement close to those of the whole number sliders if ( decimal > 0 ) { + let additionalDecimalResolution = 3 + mValue = mValue.toFixed(decimal + additionalDecimalResolution) } + if ( isSnappingToTicks ) { + mValue = Math.round((mValue - start) / step) * step + start + mValue = mValue.toFixed(decimal) + } + if ( mValue < mMinimum ) { return mMinimum; } if ( mValue > mMaximum ) { return mMaximum; } return mValue;