remove duplicate logic

This commit is contained in:
Andrea Bogazzi 2015-10-21 12:58:59 +02:00
parent 026388d93c
commit 0836408035

View file

@ -151,21 +151,13 @@
};
}
var obj = { }, proto = fabric.Shadow.prototype;
if (this.color !== proto.color) {
obj.color = this.color;
}
if (this.blur !== proto.blur) {
obj.blur = this.blur;
}
if (this.offsetX !== proto.offsetX) {
obj.offsetX = this.offsetX;
}
if (this.offsetY !== proto.offsetY) {
obj.offsetY = this.offsetY;
}
if (this.affectStroke !== proto.affectStroke) {
obj.affectStroke = this.affectStroke;
}
['color', 'blur', 'offsetX', 'offsetY', 'affectStroke'].forEach(function(prop) {
if (this[prop] !== proto[prop]) {
obj[prop] = this[prop];
}
}, this);
return obj;
}
});