check for default color property if attribute is not present

This commit is contained in:
Andrea Bogazzi 2015-12-22 01:29:11 +01:00
parent 52391f0992
commit 280746592c

View file

@ -106,10 +106,17 @@
function _setStrokeFillOpacity(attributes) {
for (var attr in colorAttributes) {
if (!attributes[attr] || typeof attributes[colorAttributes[attr]] === 'undefined') {
if (typeof attributes[colorAttributes[attr]] === 'undefined') {
continue;
}
if (!attributes[attr]) {
if (!fabric.Object.prototype[attr]) {
continue;
}
attributes[attr] = fabric.Object.prototype[attr];
}
if (attributes[attr].indexOf('url(') === 0) {
continue;
}