Skip to content

Commit 9c404cb

Browse files
author
tamat
committed
added clear_background_color to clear, prior it was using the css bg color of the container
1 parent 8ae1e55 commit 9c404cb

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/litegraph.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5198,6 +5198,7 @@ LGraphNode.prototype.executeAction = function(action)
51985198
this.editor_alpha = 1; //used for transition
51995199
this.pause_rendering = false;
52005200
this.clear_background = true;
5201+
this.clear_background_color = "#222";
52015202

52025203
this.read_only = false; //if set to true users cannot modify the graph
52035204
this.render_only_selected = true;
@@ -8235,6 +8236,17 @@ LGraphNode.prototype.executeAction = function(action)
82358236
this.ds.toCanvasContext(ctx);
82368237

82378238
//render BG
8239+
if ( this.ds.scale < 1.5 && !bg_already_painted && this.clear_background_color )
8240+
{
8241+
ctx.fillStyle = this.clear_background_color;
8242+
ctx.fillRect(
8243+
this.visible_area[0],
8244+
this.visible_area[1],
8245+
this.visible_area[2],
8246+
this.visible_area[3]
8247+
);
8248+
}
8249+
82388250
if (
82398251
this.background_image &&
82408252
this.ds.scale > 0.5 &&

0 commit comments

Comments
 (0)