* 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)
| 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) |
no test coverage detected