From 6e97a70469d08dc2c77de35e07f7f1b8e910ed4b Mon Sep 17 00:00:00 2001 From: Stefan Kienzle Date: Tue, 1 Jul 2014 18:29:06 +0200 Subject: [PATCH] Reset `backgroundColor` with null value --- src/static_canvas.class.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/static_canvas.class.js b/src/static_canvas.class.js index 07f5c44c..bc33f1dd 100644 --- a/src/static_canvas.class.js +++ b/src/static_canvas.class.js @@ -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({