From 11ce8e0f7bac242b4e0a01449d9caec48e8a8fde Mon Sep 17 00:00:00 2001 From: Chenlei Hu Date: Mon, 23 Dec 2024 20:04:32 -0500 Subject: [PATCH] Fix NODE_DEFAULT_SHAPE (#389) * Fix NODE_DEFAULT_SHAPE * update snapshot --- src/LGraphCanvas.ts | 2 +- src/LiteGraphGlobal.ts | 2 +- test/__snapshots__/litegraph.test.ts.snap | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/LGraphCanvas.ts b/src/LGraphCanvas.ts index d1aec74ae..48e009aa5 100644 --- a/src/LGraphCanvas.ts +++ b/src/LGraphCanvas.ts @@ -5145,7 +5145,7 @@ export class LGraphCanvas { const low_quality = this.ds.scale < 0.5 const { collapsed } = node.flags - const shape = node._shape || node.constructor.shape || RenderShape.ROUND + const shape = node._shape || node.constructor.shape || LiteGraph.NODE_DEFAULT_SHAPE const { title_mode } = node.constructor const render_title = title_mode == TitleMode.TRANSPARENT_TITLE || title_mode == TitleMode.NO_TITLE diff --git a/src/LiteGraphGlobal.ts b/src/LiteGraphGlobal.ts index 09034fa62..7bda51d8e 100644 --- a/src/LiteGraphGlobal.ts +++ b/src/LiteGraphGlobal.ts @@ -51,7 +51,7 @@ export class LiteGraphGlobal { NODE_DEFAULT_COLOR = "#333" NODE_DEFAULT_BGCOLOR = "#353535" NODE_DEFAULT_BOXCOLOR = "#666" - NODE_DEFAULT_SHAPE = "box" + NODE_DEFAULT_SHAPE = RenderShape.ROUND NODE_BOX_OUTLINE_COLOR = "#FFF" NODE_ERROR_COLOUR = "#E00" DEFAULT_SHADOW_COLOR = "rgba(0,0,0,0.5)" diff --git a/test/__snapshots__/litegraph.test.ts.snap b/test/__snapshots__/litegraph.test.ts.snap index 9b6de60c9..9c932a83a 100644 --- a/test/__snapshots__/litegraph.test.ts.snap +++ b/test/__snapshots__/litegraph.test.ts.snap @@ -54,7 +54,7 @@ LiteGraphGlobal { "NODE_DEFAULT_BGCOLOR": "#353535", "NODE_DEFAULT_BOXCOLOR": "#666", "NODE_DEFAULT_COLOR": "#333", - "NODE_DEFAULT_SHAPE": "box", + "NODE_DEFAULT_SHAPE": 2, "NODE_ERROR_COLOUR": "#E00", "NODE_MIN_WIDTH": 50, "NODE_MODES": [