From 13e4a68d65b94f4d564b8b371a7a5b11c3d112e4 Mon Sep 17 00:00:00 2001 From: NateScarlet Date: Thu, 25 Apr 2019 12:01:56 +0800 Subject: [PATCH] chore: build --- build/litegraph.js | 9 +++++---- build/litegraph.min.js | 8 ++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/build/litegraph.js b/build/litegraph.js index b1c3b0b3c..71b2dd6bd 100644 --- a/build/litegraph.js +++ b/build/litegraph.js @@ -2909,7 +2909,7 @@ LGraphNode.prototype.getSlotInPosition = function( x, y ) var input = this.inputs[i]; this.getConnectionPos( true,i, link_pos ); if( isInsideRectangle(x, y, link_pos[0] - 10, link_pos[1] - 5, 20,10) ) - return { input: input, slot: i, link_pos: link_pos, locked: input.locked }; + return { input: input, slot: i, link_pos: link_pos }; } if(this.outputs) @@ -2918,7 +2918,7 @@ LGraphNode.prototype.getSlotInPosition = function( x, y ) var output = this.outputs[i]; this.getConnectionPos(false,i,link_pos); if( isInsideRectangle(x, y, link_pos[0] - 10, link_pos[1] - 5, 20,10) ) - return { output: output, slot: i, link_pos: link_pos, locked: output.locked }; + return { output: output, slot: i, link_pos: link_pos }; } return null; @@ -8246,8 +8246,9 @@ LGraphCanvas.prototype.processContextMenu = function( node, event ) menu_info = []; if(slot && slot.output && slot.output.links && slot.output.links.length) menu_info.push( { content: "Disconnect Links", slot: slot } ); - menu_info.push( slot.locked ? "Cannot remove" : { content: "Remove Slot", slot: slot } ); - menu_info.push( slot.nameLocked ? "Cannot rename" : { content: "Rename Slot", slot: slot } ); + const _slot = slot.input || slot.output + menu_info.push( _slot.locked ? "Cannot remove" : { content: "Remove Slot", slot: slot } ); + menu_info.push( _slot.nameLocked ? "Cannot rename" : { content: "Rename Slot", slot: slot } ); options.title = (slot.input ? slot.input.type : slot.output.type) || "*"; if(slot.input && slot.input.type == LiteGraph.ACTION) options.title = "Action"; diff --git a/build/litegraph.min.js b/build/litegraph.min.js index efe65ec6c..5005f44a7 100755 --- a/build/litegraph.min.js +++ b/build/litegraph.min.js @@ -1591,14 +1591,14 @@ $jscomp.polyfill("Array.prototype.keys", function(w) { var g = this.inputs[c]; this.getConnectionPos(!0, c, d); if (B(a, b, d[0] - 10, d[1] - 5, 20, 10)) { - return {input:g, slot:c, link_pos:d, locked:g.locked}; + return {input:g, slot:c, link_pos:d}; } } } if (this.outputs) { for (c = 0, m = this.outputs.length; c < m; ++c) { if (g = this.outputs[c], this.getConnectionPos(!1, c, d), B(a, b, d[0] - 10, d[1] - 5, 20, 10)) { - return {output:g, slot:c, link_pos:d, locked:g.locked}; + return {output:g, slot:c, link_pos:d}; } } } @@ -4011,8 +4011,8 @@ $jscomp.polyfill("Array.prototype.keys", function(w) { } }, extra:a}, h = null; a && (h = a.getSlotInPosition(b.canvasX, b.canvasY), f.active_node = a); - h ? (e = [], h && h.output && h.output.links && h.output.links.length && e.push({content:"Disconnect Links", slot:h}), e.push(h.locked ? "Cannot remove" : {content:"Remove Slot", slot:h}), e.push(h.nameLocked ? "Cannot rename" : {content:"Rename Slot", slot:h}), l.title = (h.input ? h.input.type : h.output.type) || "*", h.input && h.input.type == c.ACTION && (l.title = "Action"), h.output && h.output.type == c.EVENT && (l.title = "Event")) : a ? e = this.getNodeMenuOptions(a) : (e = this.getCanvasMenuOptions(), - (b = this.graph.getGroupOnPos(b.canvasX, b.canvasY)) && e.push(null, {content:"Edit Group", has_submenu:!0, submenu:{title:"Group", extra:b, options:this.getGroupMenuOptions(b)}})); + h ? (e = [], h && h.output && h.output.links && h.output.links.length && e.push({content:"Disconnect Links", slot:h}), b = h.input || h.output, e.push(b.locked ? "Cannot remove" : {content:"Remove Slot", slot:h}), e.push(b.nameLocked ? "Cannot rename" : {content:"Rename Slot", slot:h}), l.title = (h.input ? h.input.type : h.output.type) || "*", h.input && h.input.type == c.ACTION && (l.title = "Action"), h.output && h.output.type == c.EVENT && (l.title = "Event")) : a ? e = this.getNodeMenuOptions(a) : + (e = this.getCanvasMenuOptions(), (h = this.graph.getGroupOnPos(b.canvasX, b.canvasY)) && e.push(null, {content:"Edit Group", has_submenu:!0, submenu:{title:"Group", extra:h, options:this.getGroupMenuOptions(h)}})); e && new c.ContextMenu(e, l, g); }; this.CanvasRenderingContext2D && (CanvasRenderingContext2D.prototype.roundRect = function(a, b, d, g, c, e) {