litegraph.js
litegraph.js copied to clipboard
Slider widget ignoring step value
Slider widgets actually ignores the step value. A simple workaround I used is to put the following code:
w.value = Math.ceil( w.value / w.options.step ) * w.options.step;
inside the LGraphCanvas.prototype.processNodeWidgets function, right after the w.value assignment. The final code I'm using looks like:
w.value =
w.options.min +
(w.options.max - w.options.min) * nvalue;
w.value = Math.ceil( w.value / w.options.step ) * w.options.step;
By the way, great tool, I'm enjoying to use.
I see, I added the step for the numerical widget, not for the slider but I will add it in the next update. Thanks :)