mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-02 19:49:58 +00:00
Add Subgraphs (#1000)
This commit is contained in:
@@ -2,7 +2,7 @@ import type { CanvasColour, DefaultConnectionColors, INodeInputSlot, INodeOutput
|
||||
import type { LGraphNode } from "@/LGraphNode"
|
||||
|
||||
import { LabelPosition, SlotShape, SlotType } from "@/draw"
|
||||
import { LiteGraph } from "@/litegraph"
|
||||
import { LiteGraph, Rectangle } from "@/litegraph"
|
||||
import { getCentre } from "@/measure"
|
||||
import { LinkDirection, RenderShape } from "@/types/globalEnums"
|
||||
|
||||
@@ -52,9 +52,12 @@ export abstract class NodeSlot extends SlotBase implements INodeSlot {
|
||||
abstract get isWidgetInputSlot(): boolean
|
||||
|
||||
constructor(slot: OptionalProps<INodeSlot, "boundingRect">, node: LGraphNode) {
|
||||
super(slot.name, slot.type, slot.boundingRect ?? [0, 0, 0, 0])
|
||||
const { boundingRect, name, type, ...rest } = slot
|
||||
const rectangle = boundingRect ? Rectangle.ensureRect(boundingRect) : new Rectangle()
|
||||
|
||||
Object.assign(this, slot)
|
||||
super(name, type, rectangle)
|
||||
|
||||
Object.assign(this, rest)
|
||||
this.#node = node
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user