Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit abffd7d

Browse files
author
Keith Clark
committed
moveGroupAttrsToElems: new transform attribute shouldn't be a reference
1 parent fd605b6 commit abffd7d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

plugins/moveGroupAttrsToElems.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,16 @@ exports.fn = function(item) {
4444
})
4545
) {
4646
item.content.forEach(function(inner) {
47+
var attr = item.attr('transform');
4748
if (inner.hasAttr('transform')) {
48-
inner.attr('transform').value = item.attr('transform').value + ' ' + inner.attr('transform').value;
49+
inner.attr('transform').value = attr.value + ' ' + inner.attr('transform').value;
4950
} else {
50-
inner.addAttr(item.attr('transform'));
51+
inner.addAttr({
52+
'name': attr.name,
53+
'local': attr.local,
54+
'prefix': attr.prefix,
55+
'value': attr.value
56+
});
5157
}
5258
});
5359

0 commit comments

Comments
 (0)