mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-04-22 23:04:42 +00:00
Fix includeDefaultValues to account for stateProperties of specific objects
This commit is contained in:
parent
ec120452c5
commit
4b78a2d819
1 changed files with 7 additions and 3 deletions
|
|
@ -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;
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue