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

plugins/mergePaths: add space delimiter between z and m

This commit is contained in:
deepsweet
2013-05-06 19:09:17 +03:00
parent 96bff9b7c7
commit 04dccd16ca
2 changed files with 11 additions and 3 deletions

View File

@ -16,7 +16,8 @@ exports.fn = function(item) {
if (item.isElem() && !item.isEmpty()) {
var prevContentItem;
var prevContentItem,
delim = '';
item.content = item.content.filter(function(contentItem) {
@ -30,7 +31,13 @@ exports.fn = function(item) {
contentItem.hasAttr('d') &&
Object.keys(contentItem.attrs).length === 1
) {
prevContentItem.attr('d').value += contentItem.attr('d').value;
// "zM", but "z m"
// looks like a FontForge parsing bug
if (contentItem.attr('d').value.charAt(0) === 'm') {
delim = ' ';
}
prevContentItem.attr('d').value += delim + contentItem.attr('d').value;
return false;
}