mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-29 10:42:44 +00:00
Allow shift+click on input to create new link from origin (#153)
This commit is contained in:
@@ -7053,16 +7053,24 @@ const globalExport = {};
|
|||||||
|
|
||||||
if (input.link !== null) {
|
if (input.link !== null) {
|
||||||
var link_info = this.graph.links[input.link]; //before disconnecting
|
var link_info = this.graph.links[input.link]; //before disconnecting
|
||||||
|
const slot = link_info.origin_slot;
|
||||||
|
const linked_node = this.graph._nodes_by_id[link_info.origin_id];
|
||||||
if (LiteGraph.click_do_break_link_to || (LiteGraph.ctrl_alt_click_do_break_link && e.ctrlKey && e.altKey && !e.shiftKey)) {
|
if (LiteGraph.click_do_break_link_to || (LiteGraph.ctrl_alt_click_do_break_link && e.ctrlKey && e.altKey && !e.shiftKey)) {
|
||||||
node.disconnectInput(i);
|
node.disconnectInput(i);
|
||||||
} else if (this.allow_reconnect_links ||
|
} else if (e.shiftKey) {
|
||||||
//this.move_destination_link_without_shift ||
|
this.connecting_links = [{
|
||||||
e.shiftKey) {
|
node: linked_node,
|
||||||
|
slot,
|
||||||
|
output: linked_node.outputs[slot],
|
||||||
|
pos: linked_node.getConnectionPos(false, slot),
|
||||||
|
}]
|
||||||
|
|
||||||
|
this.dirty_bgcanvas = true;
|
||||||
|
skip_action = true;
|
||||||
|
} else if (this.allow_reconnect_links) {
|
||||||
if (!LiteGraph.click_do_break_link_to) {
|
if (!LiteGraph.click_do_break_link_to) {
|
||||||
node.disconnectInput(i);
|
node.disconnectInput(i);
|
||||||
}
|
}
|
||||||
const linked_node = this.graph._nodes_by_id[link_info.origin_id];
|
|
||||||
const slot = link_info.origin_slot;
|
|
||||||
this.connecting_links = [
|
this.connecting_links = [
|
||||||
{
|
{
|
||||||
node: linked_node,
|
node: linked_node,
|
||||||
|
|||||||
Reference in New Issue
Block a user