Skip to content

Commit

Permalink
added clear_background_color to clear, prior it was using the css bg …
Browse files Browse the repository at this point in the history
…color of the container
  • Loading branch information
tamat committed Apr 11, 2023
1 parent 8ae1e55 commit 9c404cb
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/litegraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -5198,6 +5198,7 @@ LGraphNode.prototype.executeAction = function(action)
this.editor_alpha = 1; //used for transition
this.pause_rendering = false;
this.clear_background = true;
this.clear_background_color = "#222";

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

//render BG
if ( this.ds.scale < 1.5 && !bg_already_painted && this.clear_background_color )
{
ctx.fillStyle = this.clear_background_color;
ctx.fillRect(
this.visible_area[0],
this.visible_area[1],
this.visible_area[2],
this.visible_area[3]
);
}

if (
this.background_image &&
this.ds.scale > 0.5 &&
Expand Down

0 comments on commit 9c404cb

Please sign in to comment.