Created
November 4, 2023 23:56
-
-
Save qiaoshun8888/b7e9965bcd13b36af3fafc3dcce8afb9 to your computer and use it in GitHub Desktop.
litegraph.extensions.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Changes the background color of the canvas. | |
* | |
* @method updateBackground | |
* @param {image} String | |
* @param {clearBackgroundColor} String | |
* @ | |
*/ | |
LGraphCanvas.prototype.updateBackground = function (image, clearBackgroundColor) { | |
this._bg_img = new Image(); | |
this._bg_img.name = image; | |
this._bg_img.src = image; | |
this._bg_img.onload = () => { | |
this.draw(true, true); | |
}; | |
this.background_image = image; | |
this.clear_background = true; | |
this.clear_background_color = clearBackgroundColor; | |
this._pattern = null | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment