diff --git a/src/LGraphCanvas.ts b/src/LGraphCanvas.ts index bc06306dd..1db55445b 100644 --- a/src/LGraphCanvas.ts +++ b/src/LGraphCanvas.ts @@ -5168,7 +5168,7 @@ export class LGraphCanvas { const { collapsed } = node.flags const shape = node._shape || node.constructor.shape || LiteGraph.NODE_DEFAULT_SHAPE - const { title_mode } = node.constructor + const title_mode = node.title_mode const render_title = title_mode == TitleMode.TRANSPARENT_TITLE || title_mode == TitleMode.NO_TITLE ? false diff --git a/src/LGraphNode.ts b/src/LGraphNode.ts index 6a748bf84..70fe82537 100644 --- a/src/LGraphNode.ts +++ b/src/LGraphNode.ts @@ -291,6 +291,10 @@ export class LGraphNode implements Positionable, IPinnable { this.selected = value } + public get title_mode(): TitleMode { + return this.constructor.title_mode ?? TitleMode.NORMAL_TITLE + } + // Used in group node setInnerNodes?(this: LGraphNode, nodes: LGraphNode[]): void @@ -1617,7 +1621,7 @@ export class LGraphNode implements Positionable, IPinnable { * @param pad Expands the area by this amount on each side. Default: 0 */ measure(out: Rect, pad = 0): void { - const titleMode = this.constructor.title_mode + const titleMode = this.title_mode const renderTitle = titleMode != TitleMode.TRANSPARENT_TITLE && titleMode != TitleMode.NO_TITLE