From 0d125e1a129e5878bb2fd045a66bc658f30723b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Tue, 9 Apr 2013 09:23:08 -0700 Subject: [PATCH] Make sure Gradient#stops and #radial are alway set. --- src/color/Gradient.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/color/Gradient.js b/src/color/Gradient.js index 478681ae..b0c8d788 100644 --- a/src/color/Gradient.js +++ b/src/color/Gradient.js @@ -21,12 +21,14 @@ var Gradient = this.Gradient = Base.extend(/** @lends Gradient# */{ initialize: function(stops, radial) { // Define this Gradient's unique id. this._id = ++Base._uid; - if (!stops || !this._set(stops)) { + if (stops && this._set(stops)) + stops = radial = null; + if (!this._stops) this.setStops(stops || ['white', 'black']); + if (this._radial == null) // Support old string type argument and new radial boolean. this.setRadial(typeof radial === 'string' && radial === 'radial' || radial || false); - } }, _serialize: function(options, dictionary) {