diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2007-12-23 21:17:42 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2007-12-23 21:17:42 +0000 |
| commit | b5b3e63ac4f274288247555f6caaa3ee91327568 (patch) | |
| tree | b7411a27ca946ac2124bce3bff677ac1801ca939 /src/2geom/path.h | |
| parent | update to latest 2geom (fixed 2 bugs :)) (diff) | |
| download | inkscape-b5b3e63ac4f274288247555f6caaa3ee91327568.tar.gz inkscape-b5b3e63ac4f274288247555f6caaa3ee91327568.zip | |
update to latest 2geom, bugs be gone!
(bzr r4285)
Diffstat (limited to 'src/2geom/path.h')
| -rw-r--r-- | src/2geom/path.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/2geom/path.h b/src/2geom/path.h index 3c536c1d8..72c5d50fa 100644 --- a/src/2geom/path.h +++ b/src/2geom/path.h @@ -56,6 +56,8 @@ public: virtual Point initialPoint() const = 0; virtual Point finalPoint() const = 0; + virtual bool isDegenerate() const = 0; + virtual Curve *duplicate() const = 0; virtual Rect boundsFast() const = 0; @@ -94,6 +96,7 @@ public: Point initialPoint() const { return inner.at0(); } Point finalPoint() const { return inner.at1(); } + bool isDegenerate() const { return inner.isConstant(); } Point pointAt(Coord t) const { return inner.valueAt(t); } std::vector<Point> pointAndDerivatives(Coord t, unsigned n) const { return inner.valueAndDerivatives(t, n); @@ -168,6 +171,8 @@ public: Point initialPoint() const { return inner.at0(); } Point finalPoint() const { return inner.at1(); } + bool isDegenerate() const { return inner.isConstant(); } + void setInitial(Point v) { setPoint(0, v); } void setFinal(Point v) { setPoint(1, v); } @@ -284,6 +289,7 @@ public: //TODO: implement funcs + bool isDegenerate() const { return toSBasis().isConstant(); } Rect boundsFast() const; Rect boundsExact() const; Rect boundsLocal(Interval i, unsigned deg) const; @@ -493,8 +499,10 @@ public: ret.push_cut(0); unsigned i = 1; // ignore that path is closed or open. pw<d2<>> is always open. - for(const_iterator it = begin(); it != end(); ++it, i++) { - ret.push(it->toSBasis(), i); + for(const_iterator it = begin(); it != end(); ++it) { + if (!it->isDegenerate()) { + ret.push(it->toSBasis(), i++); + } } return ret; } |
