diff --git a/src/nouislider.ts b/src/nouislider.ts index e80a04f8..2c149235 100644 --- a/src/nouislider.ts +++ b/src/nouislider.ts @@ -607,22 +607,9 @@ class Spectrum { } public getDistance(value: number): number[] { - let index; const distances = []; - for (index = 0; index < this.xNumSteps.length - 1; index++) { - // last "range" can't contain step size as it is purely an endpoint. - const step = this.xNumSteps[index]; - - if (step && (value / step) % 1 !== 0) { - throw new Error( - "noUiSlider: 'limit', 'margin' and 'padding' of " + - this.xPct[index] + - "% range must be divisible by step." - ); - } - - // Calculate percentual distance in current range of limit, margin or padding + for (let index = 0; index < this.xNumSteps.length - 1; index++) { distances[index] = fromPercentage(this.xVal, value, index); }