From 665575a7c552fa8256df2224820dfe1635ff9f08 Mon Sep 17 00:00:00 2001 From: daine Date: Mon, 30 Apr 2018 15:13:25 +0200 Subject: [PATCH] add param to change title color --- build/litegraph.js | 5 +++-- src/litegraph.js | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/build/litegraph.js b/build/litegraph.js index 918c6e87c..e05cb2daa 100644 --- a/build/litegraph.js +++ b/build/litegraph.js @@ -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 ); } } diff --git a/src/litegraph.js b/src/litegraph.js index eb9c60734..5151291a7 100755 --- a/src/litegraph.js +++ b/src/litegraph.js @@ -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 ); } }