Fix includeDefaultValues to account for stateProperties of specific objects

This commit is contained in:
kangax 2013-09-28 23:47:13 +02:00
parent ec120452c5
commit 4b78a2d819

View file

@ -890,11 +890,15 @@
* @param {Object} object
*/
_removeDefaultValues: function(object) {
this.stateProperties.forEach(function(prop) {
if (object[prop] === this.constructor.prototype[prop]) {
var prototype = fabric.util.getKlass(object.type).prototype;
var stateProperties = prototype.stateProperties;
stateProperties.forEach(function(prop) {
if (object[prop] === prototype[prop]) {
delete object[prop];
}
}, this);
});
return object;
},