Skip to content
Open
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
8 changes: 7 additions & 1 deletion plugins/applyTransforms.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,13 @@ export const applyTransforms = (root, params) => {
(matrix.data[0] !== matrix.data[3] ||
matrix.data[1] !== -matrix.data[2]) &&
(matrix.data[0] !== -matrix.data[3] ||
matrix.data[1] !== matrix.data[2])
matrix.data[1] !== matrix.data[2]) &&
// except that non-scaling-stroke and no skew
!(
node.attributes['vector-effect'] === 'non-scaling-stroke' &&
matrix.data[1] === 0 &&
matrix.data[2] === 0
)
) {
return;
}
Expand Down
6 changes: 6 additions & 0 deletions test/plugins/convertPathData.19.svg.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 500">
<path transform="translate(250, 250) scale(1.5, 1.5) translate(-250, -250)" fill="#7ED321" stroke="#000" stroke-width="15" vector-effect="non-scaling-stroke" d="M125 125h250v250h-250v-250z"/>
<path transform="translate(20, 20) scale(.5, 1.2)" fill="#7ED321" stroke="#000" stroke-width="15" vector-effect="non-scaling-stroke" d="M125 125h250v250h-250v-250z"/>
<path fill="none" stroke="red" stroke-width="2" d="m10 10 10 10H10z" transform="matrix(1 0 0 2 10 0)" vector-effect="non-scaling-stroke"/>
<path fill="none" stroke="green" stroke-width="2" d="m10 10 10 10H10z" transform="matrix(1 0 0 2 40 0)"/>
</svg>

@@@

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 500">
<path fill="#7ED321" stroke="#000" stroke-width="15" vector-effect="non-scaling-stroke" d="M62.5 62.5h375v375h-375z"/>
<path fill="#7ED321" stroke="#000" stroke-width="15" vector-effect="non-scaling-stroke" d="M82.5 170h125v300h-125z"/>
<path fill="none" stroke="red" stroke-width="2" d="m20 20 10 20H20z" vector-effect="non-scaling-stroke"/>
<path fill="none" stroke="green" stroke-width="2" d="m10 10 10 10H10z" transform="matrix(1 0 0 2 40 0)"/>
</svg>