mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-29 02:32:18 +00:00
Merge branch 'master' of https://github.com/jagenjo/litegraph.js
This commit is contained in:
@@ -419,7 +419,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
return this.auto_sort_node_types ? r.sort() : r;
|
||||
if (this.auto_sort_node_types) {
|
||||
r.sort((a, b) => a.title.localeCompare(b.title));
|
||||
}
|
||||
|
||||
return r;
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -8852,16 +8856,15 @@ LGraphNode.prototype.executeAction = function(action)
|
||||
//inside widget
|
||||
switch (w.type) {
|
||||
case "button":
|
||||
if (event.type === "mousemove") {
|
||||
break;
|
||||
}
|
||||
if (w.callback) {
|
||||
setTimeout(function() {
|
||||
w.callback(w, that, node, pos, event);
|
||||
}, 20);
|
||||
}
|
||||
w.clicked = true;
|
||||
this.dirty_canvas = true;
|
||||
if (event.type === "mousedown") {
|
||||
if (w.callback) {
|
||||
setTimeout(function() {
|
||||
w.callback(w, that, node, pos, event);
|
||||
}, 20);
|
||||
}
|
||||
w.clicked = true;
|
||||
this.dirty_canvas = true;
|
||||
}
|
||||
break;
|
||||
case "slider":
|
||||
var range = w.options.max - w.options.min;
|
||||
@@ -10283,7 +10286,7 @@ LGraphNode.prototype.executeAction = function(action)
|
||||
var elem = document.createElement("div");
|
||||
elem.className = "property";
|
||||
elem.innerHTML = "<span class='property_name'></span><span class='property_value'></span>";
|
||||
elem.querySelector(".property_name").innerText = name;
|
||||
elem.querySelector(".property_name").innerText = options.label || name;
|
||||
var value_element = elem.querySelector(".property_value");
|
||||
value_element.innerText = str_value;
|
||||
elem.dataset["property"] = name;
|
||||
@@ -10327,7 +10330,7 @@ LGraphNode.prototype.executeAction = function(action)
|
||||
innerChange(propname, v);
|
||||
});
|
||||
}
|
||||
else if (type == "enum" || type == "combo")
|
||||
else if (type == "enum" || type == "combo") {
|
||||
var str_value = LGraphCanvas.getPropertyPrintableValue( value, options.values );
|
||||
value_element.innerText = str_value;
|
||||
|
||||
@@ -10349,6 +10352,7 @@ LGraphNode.prototype.executeAction = function(action)
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
root.content.appendChild(elem);
|
||||
|
||||
@@ -14875,7 +14879,7 @@ if (typeof exports != "undefined") {
|
||||
|
||||
//Converter
|
||||
function Converter() {
|
||||
this.addInput("in", "*");
|
||||
this.addInput("in", "");
|
||||
this.addOutput("out");
|
||||
this.size = [80, 30];
|
||||
}
|
||||
@@ -17745,7 +17749,7 @@ if (typeof exports != "undefined") {
|
||||
// Texture Webcam *****************************************
|
||||
function ImageWebcam() {
|
||||
this.addOutput("Webcam", "image");
|
||||
this.properties = { facingMode: "user" };
|
||||
this.properties = { filterFacingMode: false, facingMode: "user" };
|
||||
this.boxcolor = "black";
|
||||
this.frame = 0;
|
||||
}
|
||||
@@ -17755,8 +17759,8 @@ if (typeof exports != "undefined") {
|
||||
ImageWebcam.is_webcam_open = false;
|
||||
|
||||
ImageWebcam.prototype.openStream = function() {
|
||||
if (!navigator.getUserMedia) {
|
||||
//console.log('getUserMedia() is not supported in your browser, use chrome and enable WebRTC from about://flags');
|
||||
if (!navigator.mediaDevices.getUserMedia) {
|
||||
console.log('getUserMedia() is not supported in your browser, use chrome and enable WebRTC from about://flags');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -17765,7 +17769,7 @@ if (typeof exports != "undefined") {
|
||||
// Not showing vendor prefixes.
|
||||
var constraints = {
|
||||
audio: false,
|
||||
video: { facingMode: this.properties.facingMode }
|
||||
video: !this.properties.filterFacingMode ? true : { facingMode: this.properties.facingMode }
|
||||
};
|
||||
navigator.mediaDevices
|
||||
.getUserMedia(constraints)
|
||||
|
||||
Reference in New Issue
Block a user