Correct steps calculation
This commit is contained in:
parent
965b6d8e41
commit
eb8c6cd9b3
1 changed files with 2 additions and 4 deletions
|
@ -254,11 +254,9 @@
|
|||
if (type === 'min') newPos = this.checkLimits([newPos, this.maxPosition])[0];
|
||||
else newPos = this.checkLimits([this.minPosition, newPos])[1];
|
||||
|
||||
const lengthPerStep = this.valueRange / 100 * this.step;
|
||||
const steps = Math.round(newPos / lengthPerStep);
|
||||
|
||||
const modulus = newPos % this.step;
|
||||
const value = this.currentValue;
|
||||
value[index] = Math.round(steps * lengthPerStep);
|
||||
value[index] = newPos - modulus;
|
||||
this.currentValue = [...value];
|
||||
|
||||
if (!this.dragging) {
|
||||
|
|
Loading…
Add table
Reference in a new issue