mirror of
https://github.com/svg/svgo.git
synced 2025-07-31 07:44:22 +03:00
Don't move transform attribute to elems if there is linked object to transform. Fixes #162
This commit is contained in:
@ -35,6 +35,7 @@ exports.fn = function(item) {
|
|||||||
item.isElem('g') &&
|
item.isElem('g') &&
|
||||||
item.hasAttr('transform') &&
|
item.hasAttr('transform') &&
|
||||||
!item.isEmpty() &&
|
!item.isEmpty() &&
|
||||||
|
!item.someAttr(function(attr) { return ~attr.value.indexOf('url(') }) &&
|
||||||
item.content.every(function(inner) {
|
item.content.every(function(inner) {
|
||||||
return inner.isElem(pathElems);
|
return inner.isElem(pathElems);
|
||||||
})
|
})
|
||||||
|
15
test/plugins/moveGroupAttrsToElems.05.svg
Normal file
15
test/plugins/moveGroupAttrsToElems.05.svg
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g transform="scale(2)" clip-path="url(#a)">
|
||||||
|
<path d="M0,0 L10,20"/>
|
||||||
|
<path d="M0,10 L20,30"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
|
||||||
|
@@@
|
||||||
|
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g transform="scale(2)" clip-path="url(#a)">
|
||||||
|
<path d="M0,0 L10,20"/>
|
||||||
|
<path d="M0,10 L20,30"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 348 B |
Reference in New Issue
Block a user