sliders: steps option not working when range.min is not 0

This commit is contained in:
jean-emmanuel 2018-11-06 08:54:17 +01:00
parent e80e6c74f7
commit 2726b2dcce
2 changed files with 6 additions and 1 deletions

View file

@ -1,5 +1,10 @@
# Changelog
## 0.39.5
- bug fixes
- sliders: `steps` option not working when `range.min` is not `0`
## 0.39.4
- widgets

View file

@ -104,7 +104,7 @@ class Slider extends Canvas {
var steps = this.getProp('steps')
this.steps = Array.isArray(steps) ?
steps : typeof steps === 'number' ?
Array(steps).fill(0).map((x, i) => i / (steps - 1) * this.rangeValsMax + this.rangeValsMin)
Array(steps).fill(0).map((x, i) => i / (steps - 1) * (this.rangeValsMax - this.rangeValsMin) + this.rangeValsMin)
: this.rangeVals
}