MCPcopy Create free account
hub / github.com/Comfy-Org/litegraph.js / selectItems

Method selectItems

src/LGraphCanvas.ts:3826–3832  ·  view source on GitHub ↗

* Selects several items. * @param items Items to select - if falsy, all items on the canvas will be selected * @param add_to_current_selection If set, the items will be added to the current selection instead of replacing it

(items?: Positionable[], add_to_current_selection?: boolean)

Source from the content-addressed store, hash-verified

3824 * @param add_to_current_selection If set, the items will be added to the current selection instead of replacing it
3825 */
3826 selectItems(items?: Positionable[], add_to_current_selection?: boolean): void {
3827 const itemsToSelect = items ?? this.positionableItems
3828 if (!add_to_current_selection) this.deselectAll()
3829 for (const item of itemsToSelect) this.select(item)
3830 this.onSelectionChange?.(this.selected_nodes)
3831 this.setDirty(true)
3832 }
3833
3834 /**
3835 * selects several nodes (or adds them to the current selection)

Callers 3

processKeyMethod · 0.95
_pasteFromClipboardMethod · 0.95
selectNodesMethod · 0.95

Calls 3

deselectAllMethod · 0.95
selectMethod · 0.95
setDirtyMethod · 0.95

Tested by

no test coverage detected