mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 11:11:53 +00:00
Merge pull request #329 from mohsen-karami/master
Add the ability to select multi nodes/blocks without pressing extra keys (shift/Ctrl)
This commit is contained in:
2
src/litegraph.d.ts
vendored
2
src/litegraph.d.ts
vendored
@@ -1142,6 +1142,8 @@ export declare class LGraphCanvas {
|
|||||||
allow_interaction: boolean;
|
allow_interaction: boolean;
|
||||||
/** allows to change a connection with having to redo it again */
|
/** allows to change a connection with having to redo it again */
|
||||||
allow_reconnect_links: boolean;
|
allow_reconnect_links: boolean;
|
||||||
|
/** allow selecting multi nodes without pressing extra keys */
|
||||||
|
multi_select: boolean;
|
||||||
/** No effect */
|
/** No effect */
|
||||||
allow_searchbox: boolean;
|
allow_searchbox: boolean;
|
||||||
always_render_background: boolean;
|
always_render_background: boolean;
|
||||||
|
|||||||
@@ -5211,6 +5211,7 @@ LGraphNode.prototype.executeAction = function(action)
|
|||||||
this.allow_dragcanvas = true;
|
this.allow_dragcanvas = true;
|
||||||
this.allow_dragnodes = true;
|
this.allow_dragnodes = true;
|
||||||
this.allow_interaction = true; //allow to control widgets, buttons, collapse, etc
|
this.allow_interaction = true; //allow to control widgets, buttons, collapse, etc
|
||||||
|
this.multi_select = false; //allow selecting multi nodes without pressing extra keys
|
||||||
this.allow_searchbox = true;
|
this.allow_searchbox = true;
|
||||||
this.allow_reconnect_links = true; //allows to change a connection with having to redo it again
|
this.allow_reconnect_links = true; //allows to change a connection with having to redo it again
|
||||||
this.align_to_grid = false; //snap to grid
|
this.align_to_grid = false; //snap to grid
|
||||||
@@ -6061,9 +6062,7 @@ LGraphNode.prototype.executeAction = function(action)
|
|||||||
this.graph.beforeChange();
|
this.graph.beforeChange();
|
||||||
this.node_dragged = node;
|
this.node_dragged = node;
|
||||||
}
|
}
|
||||||
if (!this.selected_nodes[node.id]) {
|
this.processNodeSelected(node, e);
|
||||||
this.processNodeSelected(node, e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.dirty_canvas = true;
|
this.dirty_canvas = true;
|
||||||
@@ -7288,7 +7287,7 @@ LGraphNode.prototype.executeAction = function(action)
|
|||||||
};
|
};
|
||||||
|
|
||||||
LGraphCanvas.prototype.processNodeSelected = function(node, e) {
|
LGraphCanvas.prototype.processNodeSelected = function(node, e) {
|
||||||
this.selectNode(node, e && (e.shiftKey||e.ctrlKey));
|
this.selectNode(node, e && (e.shiftKey || e.ctrlKey || this.multi_select));
|
||||||
if (this.onNodeSelected) {
|
if (this.onNodeSelected) {
|
||||||
this.onNodeSelected(node);
|
this.onNodeSelected(node);
|
||||||
}
|
}
|
||||||
@@ -7324,6 +7323,7 @@ LGraphNode.prototype.executeAction = function(action)
|
|||||||
for (var i in nodes) {
|
for (var i in nodes) {
|
||||||
var node = nodes[i];
|
var node = nodes[i];
|
||||||
if (node.is_selected) {
|
if (node.is_selected) {
|
||||||
|
this.deselectNode(node);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user