diff --git a/src/lib/litegraph/src/LGraphNode.ts b/src/lib/litegraph/src/LGraphNode.ts index f01e4f761..320820d12 100644 --- a/src/lib/litegraph/src/LGraphNode.ts +++ b/src/lib/litegraph/src/LGraphNode.ts @@ -332,9 +332,6 @@ export class LGraphNode /** @inheritdoc {@link IColorable.setColorOption} */ setColorOption(colorOption: ColorOption | null): void { - const oldColor = this.color - const oldBgcolor = this.bgcolor - if (colorOption == null) { delete this.color delete this.bgcolor @@ -342,29 +339,7 @@ export class LGraphNode this.color = colorOption.color this.bgcolor = colorOption.bgcolor } - - // Trigger property change events for Vue node synchronization - if (this.graph) { - const newColor = this.color // undefined if deleted - const newBgcolor = this.bgcolor // undefined if deleted - - if (oldColor !== newColor) { - this.graph.trigger('node:property:changed', { - nodeId: this.id, - property: 'color', - oldValue: oldColor, - newValue: newColor - }) - } - if (oldBgcolor !== newBgcolor) { - this.graph.trigger('node:property:changed', { - nodeId: this.id, - property: 'bgcolor', - oldValue: oldBgcolor, - newValue: newBgcolor - }) - } - } + // Property change events are now handled automatically by LGraphNodeProperties instrumentation } /** @inheritdoc {@link IColorable.getColorOption} */ diff --git a/src/lib/litegraph/src/LGraphNodeProperties.ts b/src/lib/litegraph/src/LGraphNodeProperties.ts index 271d98e1e..f4a5d0c13 100644 --- a/src/lib/litegraph/src/LGraphNodeProperties.ts +++ b/src/lib/litegraph/src/LGraphNodeProperties.ts @@ -7,7 +7,9 @@ const DEFAULT_TRACKED_PROPERTIES: string[] = [ 'title', 'flags.collapsed', 'flags.pinned', - 'mode' + 'mode', + 'color', + 'bgcolor' ] /**