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

moveGroupAttrsToElems: new transform attribute shouldn't be a reference

This commit is contained in:
Keith Clark
2016-04-26 20:14:18 +01:00
parent fd605b6944
commit abffd7db09

View File

@ -44,10 +44,16 @@ exports.fn = function(item) {
})
) {
item.content.forEach(function(inner) {
var attr = item.attr('transform');
if (inner.hasAttr('transform')) {
inner.attr('transform').value = item.attr('transform').value + ' ' + inner.attr('transform').value;
inner.attr('transform').value = attr.value + ' ' + inner.attr('transform').value;
} else {
inner.addAttr(item.attr('transform'));
inner.addAttr({
'name': attr.name,
'local': attr.local,
'prefix': attr.prefix,
'value': attr.value
});
}
});