Revert "Add canvas update events (#297)" (#310)

This reverts commit 0e8f02f32f.
This commit is contained in:
Chenlei Hu
2024-11-16 17:32:53 -05:00
committed by GitHub
parent 0e8f02f32f
commit f26f7dbe2c
2 changed files with 7 additions and 42 deletions

View File

@@ -137,7 +137,6 @@ export class LGraph implements LinkNetwork, Serialisable<SerialisableGraph> {
onExecuteStep?(): void
onNodeAdded?(node: LGraphNode): void
onNodeRemoved?(node: LGraphNode): void
onNodeUpdated?(node: LGraphNode): void
onTrigger?(action: string, param: unknown): void
onInputRenamed?(old_name: string, name: string): void
onInputTypeChanged?(name: string, type: string): void
@@ -146,8 +145,8 @@ export class LGraph implements LinkNetwork, Serialisable<SerialisableGraph> {
onOutputRenamed?(old_name: string, name: string): void
onOutputTypeChanged?(name: string, type: string): void
onOutputRemoved?(name: string): void
onBeforeChange?(graph: LGraph, node?: LGraphNode): void
onAfterChange?(graph: LGraph, node?: LGraphNode): void
onBeforeChange?(graph: LGraph, info?: LGraphNode): void
onAfterChange?(graph: LGraph, info?: LGraphNode): void
onConnectionChange?(node: LGraphNode): void
on_change?(graph: LGraph): void
onSerialize?(data: ISerialisedGraph | SerialisableGraph): void
@@ -1206,19 +1205,15 @@ export class LGraph implements LinkNetwork, Serialisable<SerialisableGraph> {
}
}
//used for undo, called before any change is made to the graph
beforeChange(node?: LGraphNode): void {
this.onBeforeChange?.(this, node)
beforeChange(info?: LGraphNode): void {
this.onBeforeChange?.(this, info)
this.canvasAction(c => c.onBeforeChange?.(this))
}
//used to resend actions, called after any change is made to the graph
afterChange(node?: LGraphNode): void {
this.onAfterChange?.(this, node)
afterChange(info?: LGraphNode): void {
this.onAfterChange?.(this, info)
this.canvasAction(c => c.onAfterChange?.(this))
}
nodeUpdate(node?: LGraphNode): void {
this.onNodeUpdated?.(node)
this.canvasAction(c => c.onNodeUpdated?.(node))
}
connectionChange(node: LGraphNode): void {
this.updateExecutionOrder()
this.onConnectionChange?.(node)