mirror of
https://github.com/svg/svgo.git
synced 2025-07-29 20:21:14 +03:00
Add option to the mergePaths plugin, forcing all path attributes to be combined
This commit is contained in:
committed by
Lev Solntsev
parent
269c47198b
commit
b9905aa5ec
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user