* remove an existing input slot
(slot: number)
| 1556 | * remove an existing input slot |
| 1557 | */ |
| 1558 | removeInput(slot: number): void { |
| 1559 | this.disconnectInput(slot, true) |
| 1560 | const { inputs } = this |
| 1561 | const slot_info = inputs.splice(slot, 1) |
| 1562 | |
| 1563 | for (let i = slot; i < inputs.length; ++i) { |
| 1564 | const input = inputs[i] |
| 1565 | if (!input?.link) continue |
| 1566 | |
| 1567 | if (!this.graph) throw new NullGraphError() |
| 1568 | const link = this.graph._links.get(input.link) |
| 1569 | if (link) link.target_slot-- |
| 1570 | } |
| 1571 | this.onInputRemoved?.(slot, slot_info[0]) |
| 1572 | this.setDirtyCanvas(true, true) |
| 1573 | } |
| 1574 | |
| 1575 | /** |
| 1576 | * computes the minimum size of a node according to its inputs and output slots |
no test coverage detected