diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2008-06-14 15:01:19 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2008-06-14 15:01:19 +0000 |
| commit | 4289e1281e707090b4195dcb879cf1532d9ef03a (patch) | |
| tree | 6128d36f89e544e0670a6197f91715dd99e92391 /src/2geom/solve-bezier-one-d.cpp | |
| parent | fixed another typo (diff) | |
| download | inkscape-4289e1281e707090b4195dcb879cf1532d9ef03a.tar.gz inkscape-4289e1281e707090b4195dcb879cf1532d9ef03a.zip | |
update 2geom
(bzr r5931)
Diffstat (limited to 'src/2geom/solve-bezier-one-d.cpp')
| -rw-r--r-- | src/2geom/solve-bezier-one-d.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/2geom/solve-bezier-one-d.cpp b/src/2geom/solve-bezier-one-d.cpp index cd7c36cc3..3ec738df1 100644 --- a/src/2geom/solve-bezier-one-d.cpp +++ b/src/2geom/solve-bezier-one-d.cpp @@ -86,6 +86,11 @@ Bernsteins::find_bernstein_roots(double const *w, /* The control points */ /* if deep enough, return 1 solution at midpoint */ if (depth >= MAXDEPTH) { //printf("bottom out %d\n", depth); + const double Ax = right_t - left_t; + const double Ay = w[degree] - w[0]; + + solutions.push_back(left_t - Ax*w[0] / Ay); + return; solutions.push_back((left_t + right_t) / 2.0); return; } @@ -101,6 +106,7 @@ Bernsteins::find_bernstein_roots(double const *w, /* The control points */ solutions.push_back(left_t - Ax*w[0] / Ay); return; } + } /* Otherwise, solve recursively after subdividing control polygon */ |
