Make sure Gradient#stops and #radial are alway set.

This commit is contained in:
Jürg Lehni 2013-04-09 09:23:08 -07:00
parent 26efbdb451
commit 0d125e1a12

View file

@ -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) {