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];
|
if (type === 'min') newPos = this.checkLimits([newPos, this.maxPosition])[0];
|
||||||
else newPos = this.checkLimits([this.minPosition, newPos])[1];
|
else newPos = this.checkLimits([this.minPosition, newPos])[1];
|
||||||
|
|
||||||
const lengthPerStep = this.valueRange / 100 * this.step;
|
const modulus = newPos % this.step;
|
||||||
const steps = Math.round(newPos / lengthPerStep);
|
|
||||||
|
|
||||||
const value = this.currentValue;
|
const value = this.currentValue;
|
||||||
value[index] = Math.round(steps * lengthPerStep);
|
value[index] = newPos - modulus;
|
||||||
this.currentValue = [...value];
|
this.currentValue = [...value];
|
||||||
|
|
||||||
if (!this.dragging) {
|
if (!this.dragging) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue