mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-21 23:34:31 +00:00
[Refactor] Add LGraphNode.title_mode (#439)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user