Fix _initGradient with non-empty non-gradient values.

This commit is contained in:
kangax 2012-08-20 18:39:04 +02:00
parent 189b0efd34
commit 0bbaddf859
4 changed files with 3 additions and 3 deletions

2
dist/all.js vendored
View file

@ -7601,7 +7601,7 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, {
* @method initGradient
*/
_initGradient: function(options) {
if (options.fill && !(options.fill instanceof fabric.Gradient)) {
if (options.fill && typeof options.fill == 'object' && !(options.fill instanceof fabric.Gradient)) {
this.set('fill', new fabric.Gradient(options.fill));
}
},

2
dist/all.min.js vendored

File diff suppressed because one or more lines are too long

BIN
dist/all.min.js.gz vendored

Binary file not shown.

View file

@ -146,7 +146,7 @@
* @method initGradient
*/
_initGradient: function(options) {
if (options.fill && !(options.fill instanceof fabric.Gradient)) {
if (options.fill && typeof options.fill == 'object' && !(options.fill instanceof fabric.Gradient)) {
this.set('fill', new fabric.Gradient(options.fill));
}
},