"git@developer.sourcefind.cn:chenpangpang/ComfyUI.git" did not exist on "5b4e3127494674e9a3f2e668e8fb49b278e079a9"
Commit d64e2174 authored by comfyanonymous's avatar comfyanonymous
Browse files

Fix annoying float issue causing the value to be rounded to above the max.

parent 072e3bd2
...@@ -307,7 +307,9 @@ export const ComfyWidgets = { ...@@ -307,7 +307,9 @@ export const ComfyWidgets = {
return { widget: node.addWidget(widgetType, inputName, val, return { widget: node.addWidget(widgetType, inputName, val,
function (v) { function (v) {
if (config.round) { if (config.round) {
this.value = Math.round(v/config.round)*config.round; this.value = Math.round((v + Number.EPSILON)/config.round)*config.round;
if (this.value > config.max) this.value = config.max;
if (this.value < config.min) this.value = config.min;
} else { } else {
this.value = v; this.value = v;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment