mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-03 22:59:14 +00:00
add callbacks for draw TitleBar, TitleBox & TitleText
This commit is contained in:
15878
build/litegraph.js
15878
build/litegraph.js
File diff suppressed because it is too large
Load Diff
9273
build/litegraph.min.js
vendored
9273
build/litegraph.min.js
vendored
File diff suppressed because it is too large
Load Diff
@@ -5837,7 +5837,11 @@ LGraphCanvas.prototype.drawNodeShape = function( node, ctx, size, fgcolor, bgcol
|
||||
if(render_title || title_mode == LiteGraph.TRANSPARENT_TITLE )
|
||||
{
|
||||
//title bar
|
||||
if(title_mode != LiteGraph.TRANSPARENT_TITLE) //!node.flags.collapsed)
|
||||
if(node.onDrawTitleBar)
|
||||
{
|
||||
node.onDrawTitleBar(ctx, title_height, size, this.scale, fgcolor);
|
||||
}
|
||||
else if(title_mode != LiteGraph.TRANSPARENT_TITLE) //!node.flags.collapsed)
|
||||
{
|
||||
if(node.flags.collapsed)
|
||||
ctx.shadowColor = LiteGraph.DEFAULT_SHADOW_COLOR;
|
||||
@@ -5869,7 +5873,11 @@ LGraphCanvas.prototype.drawNodeShape = function( node, ctx, size, fgcolor, bgcol
|
||||
}
|
||||
|
||||
//title box
|
||||
if (shape == LiteGraph.ROUND_SHAPE || shape == LiteGraph.CIRCLE_SHAPE || shape == LiteGraph.CARD_SHAPE)
|
||||
if(node.onDrawTitleBox)
|
||||
{
|
||||
node.onDrawTitleBox(ctx, title_height, size, this.scale);
|
||||
}
|
||||
else if (shape == LiteGraph.ROUND_SHAPE || shape == LiteGraph.CIRCLE_SHAPE || shape == LiteGraph.CARD_SHAPE)
|
||||
{
|
||||
if( this.scale > 0.5 )
|
||||
{
|
||||
@@ -5897,6 +5905,10 @@ LGraphCanvas.prototype.drawNodeShape = function( node, ctx, size, fgcolor, bgcol
|
||||
ctx.globalAlpha = old_alpha;
|
||||
|
||||
//title text
|
||||
if(node.onDrawTitleText)
|
||||
{
|
||||
node.onDrawTitleText(ctx, title_height, size, this.scale, this.title_text_font, selected);
|
||||
}
|
||||
if( this.scale > 0.5 )
|
||||
{
|
||||
ctx.font = this.title_text_font;
|
||||
|
||||
Reference in New Issue
Block a user