diff options
Diffstat (limited to 'src/2geom/sbasis.cpp')
| -rw-r--r-- | src/2geom/sbasis.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/2geom/sbasis.cpp b/src/2geom/sbasis.cpp index 920fd37fe..d7a3972e1 100644 --- a/src/2geom/sbasis.cpp +++ b/src/2geom/sbasis.cpp @@ -69,15 +69,12 @@ bool SBasis::isFinite() const { } std::vector<double> SBasis::valueAndDerivatives(double t, unsigned n) const { - std::vector<double> ret(n); - if(n==1) { - ret.push_back(valueAt(t)); - return ret; - } + std::vector<double> ret(n+1); + ret.push_back(valueAt(t)); SBasis tmp = *this; for(unsigned i = 0; i < n; i++) { - ret[i] = tmp.valueAt(t); tmp.derive(); + ret[i] = tmp.valueAt(t); } return ret; } |
