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:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user