summaryrefslogtreecommitdiffstats
path: root/src/2geom/sbasis.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2008-07-03 20:06:40 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2008-07-03 20:06:40 +0000
commite07de7ce18ff4cc440dc8947d61825122afea062 (patch)
tree9ffdd823777582d6b5b8d3de135a03da42041402 /src/2geom/sbasis.cpp
parentPatch so Inkscape will compile on Solaris 10 from LP https://bugs.launchpad.n... (diff)
downloadinkscape-e07de7ce18ff4cc440dc8947d61825122afea062.tar.gz
inkscape-e07de7ce18ff4cc440dc8947d61825122afea062.zip
update 2geom (svn rev1433)
(bzr r6134)
Diffstat (limited to 'src/2geom/sbasis.cpp')
-rw-r--r--src/2geom/sbasis.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/2geom/sbasis.cpp b/src/2geom/sbasis.cpp
index d7a3972e1..377238d92 100644
--- a/src/2geom/sbasis.cpp
+++ b/src/2geom/sbasis.cpp
@@ -33,8 +33,8 @@
#include <cmath>
-#include "sbasis.h"
-#include "isnan.h"
+#include <2geom/sbasis.h>
+#include <2geom/isnan.h>
namespace Geom{
@@ -258,6 +258,8 @@ SBasis integral(SBasis const &c) {
SBasis derivative(SBasis const &a) {
SBasis c;
c.resize(a.size(), Linear(0,0));
+ if(a.isZero())
+ return c;
for(unsigned k = 0; k < a.size()-1; k++) {
double d = (2*k+1)*(a[k][1] - a[k][0]);
@@ -278,6 +280,7 @@ SBasis derivative(SBasis const &a) {
}
void SBasis::derive() { // in place version
+ if(isZero()) return;
for(unsigned k = 0; k < size()-1; k++) {
double d = (2*k+1)*((*this)[k][1] - (*this)[k][0]);