* remove an existing output slot
(slot: number)
| 1508 | * remove an existing output slot |
| 1509 | */ |
| 1510 | removeOutput(slot: number): void { |
| 1511 | this.disconnectOutput(slot) |
| 1512 | const { outputs } = this |
| 1513 | outputs.splice(slot, 1) |
| 1514 | |
| 1515 | for (let i = slot; i < outputs.length; ++i) { |
| 1516 | const output = outputs[i] |
| 1517 | if (!output || !output.links) continue |
| 1518 | |
| 1519 | for (const linkId of output.links) { |
| 1520 | if (!this.graph) throw new NullGraphError() |
| 1521 | |
| 1522 | const link = this.graph._links.get(linkId) |
| 1523 | if (link) link.origin_slot-- |
| 1524 | } |
| 1525 | } |
| 1526 | |
| 1527 | this.onOutputRemoved?.(slot) |
| 1528 | this.setDirtyCanvas(true, true) |
| 1529 | } |
| 1530 | |
| 1531 | /** |
| 1532 | * add a new input slot to use in this node |
no test coverage detected