Index: sources/gui/qml/compounds/ValueAdjuster.qml =================================================================== diff -u -ra42e662e05949b63abd4c1e51b814ce476c107d4 -r3948dd9dd1189b47bbeedf08c351dece2662d600 --- sources/gui/qml/compounds/ValueAdjuster.qml (.../ValueAdjuster.qml) (revision a42e662e05949b63abd4c1e51b814ce476c107d4) +++ sources/gui/qml/compounds/ValueAdjuster.qml (.../ValueAdjuster.qml) (revision 3948dd9dd1189b47bbeedf08c351dece2662d600) @@ -49,7 +49,7 @@ return Math.round(value * _private.multiplier) / _private.multiplier } - // calculate the minimum value rounded up to the next higher step size + // calculate the minimum value rounded up to the next lower step size function calculateMinimum() { let fixedMin = _private.fixedValue(_private.minVal) let fixedStep = _private.fixedValue(_private.stepVal) @@ -72,14 +72,18 @@ if ( ! isActive ) { didActiveChange(true); return } let tValue = _private.val + // if value can be 'off' and value is below the min, then just set value to min if (canOff && _private.val < _private.minVal) { tValue = _private.minVal } else { let fixedVal = _private.fixedValue(_private.val) let fixedStep = _private.fixedValue(_private.stepVal) + // if value is not step aligned, then fixedDelta will be next higher step, + // otherwise fixedDelta will be a whole step let fixedDelta = fixedStep - (fixedVal % fixedStep) tValue = (fixedVal + fixedDelta) / _private.multiplier + // clamp tValue between [minVal, maxVal] tValue = Math.max(_private.minVal, Math.min(_private.maxVal, tValue)) } @@ -90,14 +94,18 @@ if ( ! isActive ) { didActiveChange(true); return } let tValue = _private.val + // if value can be 'off' and value is already at minimum, just set value to 0 if (canOff && _private.val === _private.minVal) { tValue = 0 } else { let fixedVal = _private.fixedValue(_private.val) let fixedStep = _private.fixedValue(_private.stepVal) let fixedDelta = fixedVal % fixedStep + // if value is not step aligned, decrement to the next lowest step, + // otherwise decrement by a whole step tValue = (fixedVal - (fixedDelta > 0 ? fixedDelta : fixedStep)) / _private.multiplier + // clamp tValue between [minVal, maxVal] tValue = Math.min(_private.maxVal, Math.max(_private.minVal, tValue)) }