summaryrefslogtreecommitdiffstats
path: root/src/2geom/sbasis.cpp
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2015-07-15 18:47:16 +0000
committerKrzysztof KosiƄski <tweenk.pl@gmail.com>2015-07-15 18:47:16 +0000
commit3767f1ca97ac6dcacce110089fd7247669ab8e5b (patch)
treee5043c44e2071c7e31c25eb1e85f978a5c034106 /src/2geom/sbasis.cpp
parentSync 2Geom to revision 2420. (diff)
downloadinkscape-3767f1ca97ac6dcacce110089fd7247669ab8e5b.tar.gz
inkscape-3767f1ca97ac6dcacce110089fd7247669ab8e5b.zip
Update 2Geom to r2421, fix SBasis derivatives.
Fixes LP bug #1473317. Fixed bugs: - https://launchpad.net/bugs/1473317 (bzr r14248)
Diffstat (limited to 'src/2geom/sbasis.cpp')
-rw-r--r--src/2geom/sbasis.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/2geom/sbasis.cpp b/src/2geom/sbasis.cpp
index 4f1df621e..42d92d7b8 100644
--- a/src/2geom/sbasis.cpp
+++ b/src/2geom/sbasis.cpp
@@ -328,9 +328,9 @@ SBasis derivative(SBasis const &a) {
}
int k = a.size()-1;
double d = (2*k+1)*(a[k][1] - a[k][0]);
- if(d == 0)
+ if (d == 0 && k > 0) {
c.pop_back();
- else {
+ } else {
c[k][0] = d;
c[k][1] = d;
}
@@ -351,9 +351,9 @@ void SBasis::derive() { // in place version
}
int k = size()-1;
double d = (2*k+1)*((*this)[k][1] - (*this)[k][0]);
- if(d == 0)
+ if (d == 0 && k > 0) {
pop_back();
- else {
+ } else {
(*this)[k][0] = d;
(*this)[k][1] = d;
}