mirror of
https://github.com/dataarts/dat.gui.git
synced 2024-12-12 04:08:27 +00:00
NumberController Step is working properly
See details about issue in https://github.com/dataarts/dat.gui/issues/48#issuecomment-460026017
This commit is contained in:
parent
a1547d0f21
commit
af02b71d6a
@ -68,7 +68,7 @@ class NumberController extends Controller {
|
||||
_v = this.__max;
|
||||
}
|
||||
|
||||
if (this.__step !== undefined && _v % this.__step !== 0) {
|
||||
if (this.__step !== undefined && this.__step !== 0 && _v % this.__step !== 0) {
|
||||
_v = Math.round(_v / this.__step) * this.__step;
|
||||
}
|
||||
|
||||
|
@ -108,7 +108,7 @@ class NumberControllerBox extends NumberController {
|
||||
}
|
||||
|
||||
updateDisplay() {
|
||||
this.__input.value = this.__truncationSuspended ? this.getValue() : roundToDecimal(this.getValue(), this.__precision);
|
||||
this.__input.value = this.__truncationSuspended || this.__step === 0 ? this.getValue() : roundToDecimal(this.getValue(), this.__precision);
|
||||
return super.updateDisplay();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user