mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-01-11 10:25:16 +00:00
Update litegraph from upstream.
This commit is contained in:
parent
07194297fd
commit
ee3a12d283
@ -9953,11 +9953,11 @@ LGraphNode.prototype.executeAction = function(action)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "slider":
|
case "slider":
|
||||||
var range = w.options.max - w.options.min;
|
var old_value = w.value;
|
||||||
var nvalue = Math.clamp((x - 15) / (widget_width - 30), 0, 1);
|
var nvalue = Math.clamp((x - 15) / (widget_width - 30), 0, 1);
|
||||||
if(w.options.read_only) break;
|
if(w.options.read_only) break;
|
||||||
w.value = w.options.min + (w.options.max - w.options.min) * nvalue;
|
w.value = w.options.min + (w.options.max - w.options.min) * nvalue;
|
||||||
if (w.callback) {
|
if (old_value != w.value) {
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
inner_value_change(w, w.value);
|
inner_value_change(w, w.value);
|
||||||
}, 20);
|
}, 20);
|
||||||
@ -10044,7 +10044,7 @@ LGraphNode.prototype.executeAction = function(action)
|
|||||||
if (event.click_time < 200 && delta == 0) {
|
if (event.click_time < 200 && delta == 0) {
|
||||||
this.prompt("Value",w.value,function(v) {
|
this.prompt("Value",w.value,function(v) {
|
||||||
// check if v is a valid equation or a number
|
// check if v is a valid equation or a number
|
||||||
if (/^[0-9+\-*/()\s]+$/.test(v)) {
|
if (/^[0-9+\-*/()\s]+|\d+\.\d+$/.test(v)) {
|
||||||
try {//solve the equation if possible
|
try {//solve the equation if possible
|
||||||
v = eval(v);
|
v = eval(v);
|
||||||
} catch (e) { }
|
} catch (e) { }
|
||||||
|
Loading…
Reference in New Issue
Block a user