Fix handling of self-intersection in PathItem#getIntersections

Closes #1194
This commit is contained in:
Jürg Lehni 2016-12-31 11:30:38 +01:00
parent 1e9b1cd7dc
commit f995216f39

View file

@ -336,7 +336,7 @@ var PathItem = Item.extend(/** @lends PathItem# */{
values2 = [], values2 = [],
arrays = [], arrays = [],
locations, locations,
path; current;
// Cache values for curves2 as we re-iterate them for each in curves1. // Cache values for curves2 as we re-iterate them for each in curves1.
for (var i = 0; i < length2; i++) for (var i = 0; i < length2; i++)
values2[i] = curves2[i].getValues(matrix2); values2[i] = curves2[i].getValues(matrix2);
@ -348,8 +348,8 @@ var PathItem = Item.extend(/** @lends PathItem# */{
// use separate location arrays per path1, to make sure the // use separate location arrays per path1, to make sure the
// circularity checks are not getting confused by locations on // circularity checks are not getting confused by locations on
// separate paths. We are flattening the separate arrays at the end. // separate paths. We are flattening the separate arrays at the end.
if (path1 !== path) { if (path1 !== current) {
path = path1; current = path1;
locations = []; locations = [];
arrays.push(locations); arrays.push(locations);
} }