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

Check path intersection while merging.

Fixes #253, resolves #260, fixes #298.
This commit is contained in:
GreLI
2015-03-21 23:52:53 +03:00
parent e220b6cad0
commit e1060df7dc
6 changed files with 351 additions and 6 deletions

View File

@ -11,7 +11,8 @@ exports.params = {
};
var path2js = require('./_path.js').path2js,
js2path = require('./_path.js').js2path;
js2path = require('./_path.js').js2path,
interesects = require('./_path.js').interesects;
/**
* Merge multiple Paths into one.
@ -51,7 +52,7 @@ exports.fn = function(item, params) {
prevPathJS = path2js(prevContentItem),
curPathJS = path2js(contentItem);
if (equalData) {
if (equalData && !interesects(prevPathJS, curPathJS)) {
js2path(prevContentItem, prevPathJS.concat(curPathJS), params);
return false;
}