(e: CanvasPointerEvent, pointer: CanvasPointer, linkConnector: LinkConnector)
| 36 | } |
| 37 | |
| 38 | override onPointerDown(e: CanvasPointerEvent, pointer: CanvasPointer, linkConnector: LinkConnector): void { |
| 39 | // Left-click handling for dragging connections |
| 40 | if (e.button === 0) { |
| 41 | for (const slot of this.allSlots) { |
| 42 | const slotBounds = Rectangle.fromCentre(slot.pos, slot.boundingRect.height) |
| 43 | |
| 44 | if (slotBounds.containsXy(e.canvasX, e.canvasY)) { |
| 45 | pointer.onDragStart = () => { |
| 46 | linkConnector.dragNewFromSubgraphOutput(this.subgraph, this, slot) |
| 47 | } |
| 48 | pointer.onDragEnd = (eUp) => { |
| 49 | linkConnector.dropLinks(this.subgraph, eUp) |
| 50 | } |
| 51 | pointer.finally = () => { |
| 52 | linkConnector.reset(true) |
| 53 | } |
| 54 | } |
| 55 | } |
| 56 | // Check for right-click |
| 57 | } else if (e.button === 2) { |
| 58 | const slot = this.getSlotInPosition(e.canvasX, e.canvasY) |
| 59 | if (slot) this.showSlotContextMenu(slot, e) |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | /** @inheritdoc */ |
| 64 | override renameSlot(slot: SubgraphOutput, name: string): void { |
nothing calls this directly
no test coverage detected