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

(Fix #800) Add option to the mergePaths plugin, forcing all path attributes to be combined (#1084)

Add  option to the mergePaths plugin, forcing all path attributes to be combined
This commit is contained in:
Michael Irigoyen
2019-07-13 15:25:21 -04:00
committed by Lev Solntsev
parent 269c47198b
commit b9905aa5ec

View File

@ -8,6 +8,7 @@ exports.description = 'merges multiple paths in one if possible';
exports.params = {
collapseRepeated: true,
force: false,
leadingZero: true,
negativeExtraSpace: true,
noSpaceAfterFlags: true
@ -57,7 +58,7 @@ exports.fn = function(item, params) {
prevPathJS = path2js(prevContentItem),
curPathJS = path2js(contentItem);
if (equalData && !intersects(prevPathJS, curPathJS)) {
if (params.force || equalData && !intersects(prevPathJS, curPathJS)) {
js2path(prevContentItem, prevPathJS.concat(curPathJS), params);
return false;
}