Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion plugins/moveElemsAttrsToGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ export const fn = (root) => {
}
}

// preserve transform on children when group has clip-path or mask
// preserve transform on children when group has filter or clip-path or mask
if (
node.attributes['filter'] != null ||
node.attributes['clip-path'] != null ||
node.attributes.mask != null
) {
Expand Down
29 changes: 29 additions & 0 deletions test/plugins/moveElemsAttrsToGroup.08.svg.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Don't move transform if there is a filter attribute on group.

===

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
<defs>
<filter id="a" x="17" y="13" width="12" height="10" filterUnits="userSpaceOnUse">
<feGaussianBlur stdDeviation=".01"/>
</filter>
</defs>
<g filter="url(#a)">
<rect x="19" y="12" width="14" height="6" rx="3" transform="rotate(31 19 12.79)"/>
<rect x="19" y="12" width="14" height="6" rx="3" transform="rotate(31 19 12.79)"/>
</g>
</svg>

@@@

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
<defs>
<filter id="a" x="17" y="13" width="12" height="10" filterUnits="userSpaceOnUse">
<feGaussianBlur stdDeviation=".01"/>
</filter>
</defs>
<g filter="url(#a)">
<rect x="19" y="12" width="14" height="6" rx="3" transform="rotate(31 19 12.79)"/>
<rect x="19" y="12" width="14" height="6" rx="3" transform="rotate(31 19 12.79)"/>
</g>
</svg>