1
0
mirror of https://github.com/svg/svgo.git synced 2025-07-29 20:21:14 +03:00

Fix final sorting condition in ‘sortDefsChildren’

This commit is contained in:
GreLI
2019-07-13 21:43:36 +03:00
parent 8d0b9b8bf8
commit 4dfbd76d59
2 changed files with 3 additions and 3 deletions

View File

@ -37,7 +37,7 @@ exports.fn = function(item) {
if (lengthComparison !== 0) {
return lengthComparison;
}
return a.elem > b.elem;
return a.elem != b.elem ? a.elem > b.elem ? -1 : 1 : 0;
});
}

View File

@ -19,13 +19,13 @@
<defs>
<circle id="e" fill="none" fill-rule="evenodd" cx="60" cy="60" r="50"/>
<circle id="f" fill="none" fill-rule="evenodd" cx="60" cy="60" r="50"/>
<path id="b" d="M0 0zM10 10zM20 20l10 10M30 0c10 0 20 10 20 20M30 30z"/>
<path id="d" d="M 30,30 z"/>
<text id="a">
referenced text
</text>
<text id="c">
referenced text
</text>
<path id="b" d="M0 0zM10 10zM20 20l10 10M30 0c10 0 20 10 20 20M30 30z"/>
<path id="d" d="M 30,30 z"/>
</defs>
</svg>

Before

Width:  |  Height:  |  Size: 968 B

After

Width:  |  Height:  |  Size: 968 B