diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2012-03-04 20:14:33 +0000 |
|---|---|---|
| committer | Johan B. C. Engelen <j.b.c.engelen@alumnus.utwente.nl> | 2012-03-04 20:14:33 +0000 |
| commit | 2cdb2f9439129fba16728110ac50633065dfa9ca (patch) | |
| tree | d19e0d2ab6a2101260e9adcf0a94254b2313e5f6 /src/2geom/bezier.h | |
| parent | Cmake build fix (diff) | |
| download | inkscape-2cdb2f9439129fba16728110ac50633065dfa9ca.tar.gz inkscape-2cdb2f9439129fba16728110ac50633065dfa9ca.zip | |
2geom: isConstant and isZero should check a finite neighbourhood around zero.
(bzr r11045)
Diffstat (limited to 'src/2geom/bezier.h')
| -rw-r--r-- | src/2geom/bezier.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/2geom/bezier.h b/src/2geom/bezier.h index 1e1b88587..176128328 100644 --- a/src/2geom/bezier.h +++ b/src/2geom/bezier.h @@ -193,15 +193,15 @@ public: //IMPL: FragmentConcept typedef Coord output_type; - inline bool isZero() const { + inline bool isZero(double eps=EPSILON) const { for(unsigned i = 0; i <= order(); i++) { - if(c_[i] != 0) return false; + if( ! are_near(c_[i], 0., eps) ) return false; } return true; } - inline bool isConstant() const { + inline bool isConstant(double eps=EPSILON) const { for(unsigned i = 1; i <= order(); i++) { - if(c_[i] != c_[0]) return false; + if( ! are_near(c_[i], c_[0], eps) ) return false; } return true; } |
