Merge remote-tracking branch 'origin/master' into solve-cubic

This commit is contained in:
Jürg Lehni 2015-01-02 16:37:50 +01:00
commit 41c0584f35

View file

@ -1076,7 +1076,12 @@ new function() { // Scope for methods that require numerical integration
tMin, tMax, uMin, uMax, oldTDiff, reverse, recursion) { tMin, tMax, uMin, uMax, oldTDiff, reverse, recursion) {
/*#*/ if (__options.fatlineClipping) { /*#*/ if (__options.fatlineClipping) {
// Avoid deeper recursion. // Avoid deeper recursion.
if (recursion > 20) // NOTE: @iconexperience determined that more than 20 recursions are
// needed sometimes, depending on the tDiff threshold values further
// below when determining which curve converges the least. He also
// recommended a threshold of 0.5 instead of the initial 0.8
// See: https://github.com/paperjs/paper.js/issues/565
if (recursion > 32)
return; return;
// Let P be the first curve and Q be the second // Let P be the first curve and Q be the second
var q0x = v2[0], q0y = v2[1], q3x = v2[6], q3y = v2[7], var q0x = v2[0], q0y = v2[1], q3x = v2[6], q3y = v2[7],
@ -1127,7 +1132,7 @@ new function() { // Scope for methods that require numerical integration
tMaxNew = tMax * tMaxClip + tMin * (1 - tMaxClip); tMaxNew = tMax * tMaxClip + tMin * (1 - tMaxClip);
} }
// Check if we need to subdivide the curves // Check if we need to subdivide the curves
if (oldTDiff > 0.8 && tDiff > 0.8) { if (oldTDiff > 0.5 && tDiff > 0.5) {
// Subdivide the curve which has converged the least. // Subdivide the curve which has converged the least.
if (tMaxNew - tMinNew > uMax - uMin) { if (tMaxNew - tMinNew > uMax - uMin) {
var parts = Curve.subdivide(v1, 0.5), var parts = Curve.subdivide(v1, 0.5),