* Arranges the layout of the node's widget input slots.
()
| 3790 | * Arranges the layout of the node's widget input slots. |
| 3791 | */ |
| 3792 | #arrangeWidgetInputSlots(): void { |
| 3793 | if (!this.widgets) return |
| 3794 | |
| 3795 | const slotByWidgetName = new Map<string, INodeInputSlot & { index: number }>() |
| 3796 | |
| 3797 | for (const [i, slot] of this.inputs.entries()) { |
| 3798 | if (!isWidgetInputSlot(slot)) continue |
| 3799 | |
| 3800 | slotByWidgetName.set(slot.widget.name, { ...slot, index: i }) |
| 3801 | } |
| 3802 | if (!slotByWidgetName.size) return |
| 3803 | |
| 3804 | for (const widget of this.widgets) { |
| 3805 | const slot = slotByWidgetName.get(widget.name) |
| 3806 | if (!slot) continue |
| 3807 | |
| 3808 | const actualSlot = this.#concreteInputs[slot.index] |
| 3809 | const offset = LiteGraph.NODE_SLOT_HEIGHT * 0.5 |
| 3810 | actualSlot.pos = [offset, widget.y + offset] |
| 3811 | this.#measureSlot(actualSlot, slot.index, true) |
| 3812 | } |
| 3813 | } |
| 3814 | |
| 3815 | /** |
| 3816 | * @internal Sets the internal concrete slot arrays, ensuring they are instances of |
no test coverage detected