mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Merge handling of flat curves.
This commit is contained in:
parent
44be94e55e
commit
f28e6ba372
1 changed files with 6 additions and 8 deletions
|
@ -153,15 +153,13 @@ function getCurveIntersections(v1, v2, curve1, curve2, locations,
|
|||
// as lines.
|
||||
var flat1 = Curve.isFlatEnough(part1, /*#=*/ Numerical.TOLERANCE),
|
||||
flat2 = Curve.isFlatEnough(part2, /*#=*/ Numerical.TOLERANCE);
|
||||
if (flat1 && flat2) {
|
||||
getLineLineIntersection(part1, part2, curve1, curve2, locations);
|
||||
break;
|
||||
}
|
||||
if (flat1 || flat2) {
|
||||
// Use curve line intersection method while specifying which
|
||||
// curve to be treated as line
|
||||
getCurveLineIntersections(part1, part2, curve1, curve2, locations,
|
||||
flat1);
|
||||
(flat1 && flat2
|
||||
? getLineLineIntersection
|
||||
// Use curve line intersection method while specifying
|
||||
// which curve to be treated as line
|
||||
: getCurveLineIntersections)(part1, part2,
|
||||
curve1, curve2, locations, flat1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue