mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-07 13:22:07 -05:00
Try linked up intersections first before switching to the other intersecetion.
This commit is contained in:
parent
632eb25f19
commit
7496a7c9e2
1 changed files with 13 additions and 13 deletions
|
@ -591,19 +591,19 @@ PathItem.inject(new function() {
|
||||||
|| (!strict || isValid(seg, true))
|
|| (!strict || isValid(seg, true))
|
||||||
&& isValid(next, !strict && inter._overlap))
|
&& isValid(next, !strict && inter._overlap))
|
||||||
? inter
|
? inter
|
||||||
// If it's no match, check the other intersection first, then
|
// If it's no match, check the next linked intersection first,
|
||||||
// carry on with the next linked intersection.
|
// otherwise carry on with the 'other' intersection location.
|
||||||
: !ignoreOther
|
: inter._next !== prev // Prevent circular loops
|
||||||
// We need to get the intersection on the segment, not
|
&& getIntersection(strict, inter._next, inter, false)
|
||||||
// on inter, since multiple solutions are only linked up
|
// We need to get the intersection on the segment, not
|
||||||
// as a chain through _next there. But do not check that
|
// on inter, since multiple solutions are only linked up
|
||||||
// intersection in the first call to getIntersection()
|
// as a chain through _next there. But do not check that
|
||||||
// (prev == null), since we'd go straight back to the
|
// intersection in the first call to getIntersection()
|
||||||
// originating segment.
|
// (prev == null), since we'd go straight back to the
|
||||||
&& (prev || seg._intersection !== inter._intersection)
|
// originating segment.
|
||||||
&& getIntersection(strict, seg._intersection, inter, true)
|
|| !ignoreOther
|
||||||
|| inter._next !== prev // Prevent circular loops
|
&& (prev || seg._intersection !== inter._intersection)
|
||||||
&& getIntersection(strict, inter._next, inter, false);
|
&& getIntersection(strict, seg._intersection, inter, true);
|
||||||
}
|
}
|
||||||
for (var i = 0, l = segments.length; i < l; i++) {
|
for (var i = 0, l = segments.length; i < l; i++) {
|
||||||
var seg = segments[i],
|
var seg = segments[i],
|
||||||
|
|
Loading…
Reference in a new issue