mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-19 06:00:56 -05:00
Implement optimal values in fat line clipping code for maximum recursion and curve time difference, as determined by @iconexperience.
Closes #565
This commit is contained in:
parent
45c86a3035
commit
b75def3f3a
1 changed files with 2 additions and 2 deletions
|
@ -1056,7 +1056,7 @@ new function() { // Scope for methods that require numerical integration
|
|||
tMin, tMax, uMin, uMax, oldTDiff, reverse, recursion) {
|
||||
/*#*/ if (__options.fatlineClipping) {
|
||||
// Avoid deeper recursion.
|
||||
if (recursion > 20)
|
||||
if (recursion > 32)
|
||||
return;
|
||||
// Let P be the first curve and Q be the second
|
||||
var q0x = v2[0], q0y = v2[1], q3x = v2[6], q3y = v2[7],
|
||||
|
@ -1107,7 +1107,7 @@ new function() { // Scope for methods that require numerical integration
|
|||
tMaxNew = tMax * tMaxClip + tMin * (1 - tMaxClip);
|
||||
}
|
||||
// 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.
|
||||
if (tMaxNew - tMinNew > uMax - uMin) {
|
||||
var parts = Curve.subdivide(v1, 0.5),
|
||||
|
|
Loading…
Reference in a new issue