diff --git a/build/litegraph.js b/build/litegraph.js index 4f314d8a0..ec9379485 100644 --- a/build/litegraph.js +++ b/build/litegraph.js @@ -2805,6 +2805,7 @@ function LGraphCanvas( canvas, graph, options ) this.max_zoom = 10; this.min_zoom = 0.1; + this.zoom_modify_alpha = false; this.title_text_font = "bold 14px Arial"; this.inner_text_font = "normal 12px Arial"; @@ -4505,7 +4506,10 @@ LGraphCanvas.prototype.drawBackCanvas = function() //render BG if(this.background_image && this.scale > 0.5) { - ctx.globalAlpha = (1.0 - 0.5 / this.scale) * this.editor_alpha; + if (zoom_modify_alpha) + ctx.globalAlpha = (1.0 - 0.5 / this.scale) * this.editor_alpha; + else + ctx.globalAlpha = this.editor_alpha; ctx.imageSmoothingEnabled = ctx.mozImageSmoothingEnabled = ctx.imageSmoothingEnabled = false; if(!this._bg_img || this._bg_img.name != this.background_image) { diff --git a/src/litegraph.js b/src/litegraph.js index d27f36b86..df5ffcde3 100755 --- a/src/litegraph.js +++ b/src/litegraph.js @@ -2803,6 +2803,7 @@ function LGraphCanvas( canvas, graph, options ) this.max_zoom = 10; this.min_zoom = 0.1; + this.zoom_modify_alpha = false; this.title_text_font = "bold 14px Arial"; this.inner_text_font = "normal 12px Arial"; @@ -4503,7 +4504,10 @@ LGraphCanvas.prototype.drawBackCanvas = function() //render BG if(this.background_image && this.scale > 0.5) { - ctx.globalAlpha = (1.0 - 0.5 / this.scale) * this.editor_alpha; + if (zoom_modify_alpha) + ctx.globalAlpha = (1.0 - 0.5 / this.scale) * this.editor_alpha; + else + ctx.globalAlpha = this.editor_alpha; ctx.imageSmoothingEnabled = ctx.mozImageSmoothingEnabled = ctx.imageSmoothingEnabled = false; if(!this._bg_img || this._bg_img.name != this.background_image) {