mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-22 07:19:57 -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.
|
// as lines.
|
||||||
var flat1 = Curve.isFlatEnough(part1, /*#=*/ Numerical.TOLERANCE),
|
var flat1 = Curve.isFlatEnough(part1, /*#=*/ Numerical.TOLERANCE),
|
||||||
flat2 = Curve.isFlatEnough(part2, /*#=*/ Numerical.TOLERANCE);
|
flat2 = Curve.isFlatEnough(part2, /*#=*/ Numerical.TOLERANCE);
|
||||||
if (flat1 && flat2) {
|
|
||||||
getLineLineIntersection(part1, part2, curve1, curve2, locations);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (flat1 || flat2) {
|
if (flat1 || flat2) {
|
||||||
// Use curve line intersection method while specifying which
|
(flat1 && flat2
|
||||||
// curve to be treated as line
|
? getLineLineIntersection
|
||||||
getCurveLineIntersections(part1, part2, curve1, curve2, locations,
|
// Use curve line intersection method while specifying
|
||||||
flat1);
|
// which curve to be treated as line
|
||||||
|
: getCurveLineIntersections)(part1, part2,
|
||||||
|
curve1, curve2, locations, flat1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue