ker/mod/tfw.view.slider.js
function xToValue(x) {
    const
        rect = this.$.getBoundingClientRect(),
        percent = x / rect.width,
        range = this.max - this.min,
        value = Math.floor(percent * range + 0.5);
    return this.min + this.step * Math.floor(value / this.step);
}
function xToValue(x) {
    const
        rect = this.$.getBoundingClientRect(),
        percent = x / rect.width,
        range = this.max - this.min,
        value = Math.floor(percent * range + 0.5);
    return this.min + this.step * Math.floor(value / this.step);
}
function xToValue ( x ) { const rect = this . $ . getBoundingClientRect ( ) , percent = x / rect . width , range = this . max - this . min , value = Math . floor ( percent * range + 0.5 ) ; return this . min + this . step * Math . floor ( value / this . step ) ; }
Convert a X position into the nearest value.

@this ViewXJS
@param   {float} x - X position relative to the View.
@returns {integer} The nearest integer value.
Convert a X position into the nearest value .