mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-04-15 11:50:59 +00:00
Merge pull request #1445 from Kienz/fix-reset-bgcolor
Allow reset `backgroundColor` with null value
This commit is contained in:
commit
d692fcb466
1 changed files with 3 additions and 3 deletions
|
|
@ -329,7 +329,7 @@
|
|||
* @private
|
||||
* @param {String} property Property to set ({@link fabric.StaticCanvas#backgroundImage|backgroundImage}
|
||||
* or {@link fabric.StaticCanvas#overlayImage|overlayImage})
|
||||
* @param {(fabric.Image|String)} image fabric.Image instance or URL of an image to set background or overlay to
|
||||
* @param {(fabric.Image|String|null)} image fabric.Image instance, URL of an image or null to set background or overlay to
|
||||
* @param {Function} callback Callback to invoke when image is loaded and set as background or overlay
|
||||
* @param {Object} [options] Optional options to set for the {@link fabric.Image|image}.
|
||||
*/
|
||||
|
|
@ -352,11 +352,11 @@
|
|||
* @private
|
||||
* @param {String} property Property to set ({@link fabric.StaticCanvas#backgroundColor|backgroundColor}
|
||||
* or {@link fabric.StaticCanvas#overlayColor|overlayColor})
|
||||
* @param {(Object|String)} color Object with pattern information or color value
|
||||
* @param {(Object|String|null)} color Object with pattern information, color value or null
|
||||
* @param {Function} [callback] Callback is invoked when color is set
|
||||
*/
|
||||
__setBgOverlayColor: function(property, color, callback) {
|
||||
if (color.source) {
|
||||
if (color && color.source) {
|
||||
var _this = this;
|
||||
fabric.util.loadImage(color.source, function(img) {
|
||||
_this[property] = new fabric.Pattern({
|
||||
|
|
|
|||
Loading…
Reference in a new issue