add param to change title color

This commit is contained in:
daine
2018-04-30 15:13:25 +02:00
parent 750594698b
commit 665575a7c5
2 changed files with 6 additions and 4 deletions

View File

@@ -2809,6 +2809,7 @@ function LGraphCanvas( canvas, graph, options )
this.title_text_font = "bold 14px Arial";
this.inner_text_font = "normal 12px Arial";
this.node_title_color = LiteGraph.NODE_TITLE_COLOR;
this.default_link_color = "#AAC";
this.default_connection_color = {
input_off: "#AAC",
@@ -4506,7 +4507,7 @@ LGraphCanvas.prototype.drawBackCanvas = function()
//render BG
if(this.background_image && this.scale > 0.5)
{
if (this.zoom_modify_alpha)
if (zoom_modify_alpha)
ctx.globalAlpha = (1.0 - 0.5 / this.scale) * this.editor_alpha;
else
ctx.globalAlpha = this.editor_alpha;
@@ -4894,7 +4895,7 @@ LGraphCanvas.prototype.drawNodeShape = function(node, ctx, size, fgcolor, bgcolo
var title = node.getTitle();
if(title && this.scale > 0.5)
{
ctx.fillStyle = LiteGraph.NODE_TITLE_COLOR;
ctx.fillStyle = this.node_title_color;
ctx.fillText( title, 16, 13 - title_height );
}
}

View File

@@ -2807,6 +2807,7 @@ function LGraphCanvas( canvas, graph, options )
this.title_text_font = "bold 14px Arial";
this.inner_text_font = "normal 12px Arial";
this.node_title_color = LiteGraph.NODE_TITLE_COLOR;
this.default_link_color = "#AAC";
this.default_connection_color = {
input_off: "#AAC",
@@ -4504,7 +4505,7 @@ LGraphCanvas.prototype.drawBackCanvas = function()
//render BG
if(this.background_image && this.scale > 0.5)
{
if (this.zoom_modify_alpha)
if (zoom_modify_alpha)
ctx.globalAlpha = (1.0 - 0.5 / this.scale) * this.editor_alpha;
else
ctx.globalAlpha = this.editor_alpha;
@@ -4892,7 +4893,7 @@ LGraphCanvas.prototype.drawNodeShape = function(node, ctx, size, fgcolor, bgcolo
var title = node.getTitle();
if(title && this.scale > 0.5)
{
ctx.fillStyle = LiteGraph.NODE_TITLE_COLOR;
ctx.fillStyle = this.node_title_color;
ctx.fillText( title, 16, 13 - title_height );
}
}