Fix NODE_DEFAULT_SHAPE in color palette (#2033)

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Chenlei Hu
2024-12-23 20:44:52 -05:00
committed by GitHub
parent 3b9a5a61b2
commit e2bbfe7d80
15 changed files with 70 additions and 13 deletions

View File

@@ -276,7 +276,19 @@ app.registerExtension({
colorPalette.colors.litegraph_base.hasOwnProperty(key) &&
LiteGraph.hasOwnProperty(key)
) {
LiteGraph[key] = colorPalette.colors.litegraph_base[key]
const value = colorPalette.colors.litegraph_base[key]
if (key === 'NODE_DEFAULT_SHAPE' && typeof value === 'string') {
console.warn(
`litegraph_base.NODE_DEFAULT_SHAPE only accepts [${[
LiteGraph.BOX_SHAPE,
LiteGraph.ROUND_SHAPE,
LiteGraph.CARD_SHAPE
].join(', ')}] but got ${value}`
)
LiteGraph.NODE_DEFAULT_SHAPE = LiteGraph.ROUND_SHAPE
} else {
LiteGraph[key] = value
}
}
}
}