diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2014-01-12 23:25:39 +0000 |
|---|---|---|
| committer | Johan B. C. Engelen <j.b.c.engelen@alumnus.utwente.nl> | 2014-01-12 23:25:39 +0000 |
| commit | 5eb9b4815a12cc0dafd07905f7715a7e15a92b41 (patch) | |
| tree | f39f5ae5a40012fa010402611d2b133553c22335 /src/2geom/solve-bezier-one-d.cpp | |
| parent | LPE: rename function getHelperPaths --> getCanvasIndicators (the function is ... (diff) | |
| download | inkscape-5eb9b4815a12cc0dafd07905f7715a7e15a92b41.tar.gz inkscape-5eb9b4815a12cc0dafd07905f7715a7e15a92b41.zip | |
update 2geom's copy to r2142
(bzr r12921)
Diffstat (limited to 'src/2geom/solve-bezier-one-d.cpp')
| -rw-r--r-- | src/2geom/solve-bezier-one-d.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/2geom/solve-bezier-one-d.cpp b/src/2geom/solve-bezier-one-d.cpp index f14f701d0..3d87d4926 100644 --- a/src/2geom/solve-bezier-one-d.cpp +++ b/src/2geom/solve-bezier-one-d.cpp @@ -92,11 +92,10 @@ void Bernsteins::find_bernstein_roots(double const *w, /* The control points */ int old_sign = SGN(w[0]); //std::cout << "w[0] = " << w[0] << std::endl; - int sign; for (size_t i = 1; i < N; i++) { //std::cout << "w[" << i << "] = " << w[i] << std::endl; - sign = SGN(w[i]); + int sign = SGN(w[i]); if (sign != 0) { if (sign != old_sign && old_sign != 0) @@ -128,14 +127,14 @@ void Bernsteins::find_bernstein_roots(double const *w, /* The control points */ double s = 0, t = 1; double e = 1e-10; int side = 0; - double r, fr, fs = w[0], ft = w[degree]; + double r, fs = w[0], ft = w[degree]; for (size_t n = 0; n < 100; ++n) { r = (fs*t - ft*s) / (fs - ft); if (fabs(t-s) < e * fabs(t+s)) break; - fr = horner(w, r); + double fr = horner(w, r); if (fr * ft > 0) { |
