|
2533 | 2533 | var w = this.widgets[i];
|
2534 | 2534 | if(!w)
|
2535 | 2535 | continue;
|
2536 |
| - if(w.options && w.options.property && this.properties[ w.options.property ]) |
| 2536 | + if(w.options && w.options.property && (this.properties[ w.options.property ] != undefined)) |
2537 | 2537 | w.value = JSON.parse( JSON.stringify( this.properties[ w.options.property ] ) );
|
2538 | 2538 | }
|
2539 | 2539 | if (info.widgets_values) {
|
@@ -4928,9 +4928,7 @@ LGraphNode.prototype.executeAction = function(action)
|
4928 | 4928 | this.title = o.title;
|
4929 | 4929 | this._bounding.set(o.bounding);
|
4930 | 4930 | this.color = o.color;
|
4931 |
| - if (o.font_size) { |
4932 |
| - this.font_size = o.font_size; |
4933 |
| - } |
| 4931 | + this.font_size = o.font_size; |
4934 | 4932 | };
|
4935 | 4933 |
|
4936 | 4934 | LGraphGroup.prototype.serialize = function() {
|
@@ -5714,10 +5712,10 @@ LGraphNode.prototype.executeAction = function(action)
|
5714 | 5712 | * @method enableWebGL
|
5715 | 5713 | **/
|
5716 | 5714 | LGraphCanvas.prototype.enableWebGL = function() {
|
5717 |
| - if (typeof GL === undefined) { |
| 5715 | + if (typeof GL === "undefined") { |
5718 | 5716 | throw "litegl.js must be included to use a WebGL canvas";
|
5719 | 5717 | }
|
5720 |
| - if (typeof enableWebGLCanvas === undefined) { |
| 5718 | + if (typeof enableWebGLCanvas === "undefined") { |
5721 | 5719 | throw "webglCanvas.js must be included to use this feature";
|
5722 | 5720 | }
|
5723 | 5721 |
|
@@ -7110,15 +7108,16 @@ LGraphNode.prototype.executeAction = function(action)
|
7110 | 7108 | }
|
7111 | 7109 | };
|
7112 | 7110 |
|
7113 |
| - LGraphCanvas.prototype.copyToClipboard = function() { |
| 7111 | + LGraphCanvas.prototype.copyToClipboard = function(nodes) { |
7114 | 7112 | var clipboard_info = {
|
7115 | 7113 | nodes: [],
|
7116 | 7114 | links: []
|
7117 | 7115 | };
|
7118 | 7116 | var index = 0;
|
7119 | 7117 | var selected_nodes_array = [];
|
7120 |
| - for (var i in this.selected_nodes) { |
7121 |
| - var node = this.selected_nodes[i]; |
| 7118 | + if (!nodes) nodes = this.selected_nodes; |
| 7119 | + for (var i in nodes) { |
| 7120 | + var node = nodes[i]; |
7122 | 7121 | if (node.clonable === false)
|
7123 | 7122 | continue;
|
7124 | 7123 | node._relative_id = index;
|
@@ -11702,7 +11701,7 @@ LGraphNode.prototype.executeAction = function(action)
|
11702 | 11701 | default:
|
11703 | 11702 | iS = 0; // try with first if no name set
|
11704 | 11703 | }
|
11705 |
| - if (typeof options.node_from.outputs[iS] !== undefined){ |
| 11704 | + if (typeof options.node_from.outputs[iS] !== "undefined"){ |
11706 | 11705 | if (iS!==false && iS>-1){
|
11707 | 11706 | options.node_from.connectByType( iS, node, options.node_from.outputs[iS].type );
|
11708 | 11707 | }
|
@@ -11730,7 +11729,7 @@ LGraphNode.prototype.executeAction = function(action)
|
11730 | 11729 | default:
|
11731 | 11730 | iS = 0; // try with first if no name set
|
11732 | 11731 | }
|
11733 |
| - if (typeof options.node_to.inputs[iS] !== undefined){ |
| 11732 | + if (typeof options.node_to.inputs[iS] !== "undefined"){ |
11734 | 11733 | if (iS!==false && iS>-1){
|
11735 | 11734 | // try connection
|
11736 | 11735 | options.node_to.connectByTypeOutput(iS,node,options.node_to.inputs[iS].type);
|
|
0 commit comments