mirror of
https://github.com/svg/svgo.git
synced 2025-07-31 07:44:22 +03:00
moveGroupAttrsToElems now applies transforms to sub-groups & text.
This commit is contained in:
@ -32,8 +32,8 @@ plugins:
|
|||||||
- removeHiddenElems
|
- removeHiddenElems
|
||||||
- removeEmptyText
|
- removeEmptyText
|
||||||
- moveElemsAttrsToGroup
|
- moveElemsAttrsToGroup
|
||||||
- collapseGroups
|
|
||||||
- moveGroupAttrsToElems
|
- moveGroupAttrsToElems
|
||||||
|
- collapseGroups
|
||||||
- convertPathData
|
- convertPathData
|
||||||
- convertTransform
|
- convertTransform
|
||||||
- removeEmptyAttrs
|
- removeEmptyAttrs
|
||||||
|
@ -1,10 +1,13 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
exports.type = 'perItemReverse';
|
exports.type = 'perItem';
|
||||||
|
|
||||||
exports.active = true;
|
exports.active = true;
|
||||||
|
|
||||||
var pathElems = require('./_collections.js').pathElems;
|
var pathElems = require('./_collections.js').pathElems.slice();
|
||||||
|
|
||||||
|
pathElems.push('g');
|
||||||
|
pathElems.push('text');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Move group attrs to the content elements.
|
* Move group attrs to the content elements.
|
||||||
|
19
test/plugins/moveGroupAttrsToElems.03.svg
Normal file
19
test/plugins/moveGroupAttrsToElems.03.svg
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g transform="rotate(30)">
|
||||||
|
<g transform="scale(2)">
|
||||||
|
<path d="M0,0 L10,20"/>
|
||||||
|
<path d="M0,10 L20,30"/>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
|
||||||
|
@@@
|
||||||
|
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g>
|
||||||
|
<g>
|
||||||
|
<path d="M0,0 L10,20" transform="rotate(30) scale(2)"/>
|
||||||
|
<path d="M0,10 L20,30" transform="rotate(30) scale(2)"/>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 440 B |
25
test/plugins/moveGroupAttrsToElems.04.svg
Normal file
25
test/plugins/moveGroupAttrsToElems.04.svg
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g transform="rotate(30)">
|
||||||
|
<g>
|
||||||
|
<g transform="scale(2)">
|
||||||
|
<path d="M0,0 L10,20"/>
|
||||||
|
<path d="M0,10 L20,30"/>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<path d="M0,10 L20,30"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
|
||||||
|
@@@
|
||||||
|
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g>
|
||||||
|
<g>
|
||||||
|
<g>
|
||||||
|
<path d="M0,0 L10,20" transform="rotate(30) scale(2)"/>
|
||||||
|
<path d="M0,10 L20,30" transform="rotate(30) scale(2)"/>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<path d="M0,10 L20,30" transform="rotate(30)"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 611 B |
Reference in New Issue
Block a user