1
0
mirror of https://github.com/svg/svgo.git synced 2025-07-29 20:21:14 +03:00

plugins/moveElemsAttrsToGroup: fix bug with a wrong attrs intersecting

This commit is contained in:
deepsweet
2012-09-29 14:26:26 +04:00
parent f18439dac2
commit 93b1078a24
2 changed files with 6 additions and 3 deletions

View File

@ -34,22 +34,23 @@ exports.moveElemsAttrsToGroup = function(item, params) {
if (!Object.keys(intersection).length) {
intersection = g.attrs;
} else {
intersection = intersectAttrs(intersection, g.attrs)
intersection = intersectAttrs(intersection, g.attrs);
if (!intersection) return false;
}
return true;
}
});
if (every && Object.keys(intersection).length) {
if (every) {
item.content.forEach(function(g) {
for (var name in intersection) {
g.removeAttr(name);
item.addAttr(intersection[name]);
}
});
}
}