diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2007-11-07 23:49:18 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2007-11-07 23:49:18 +0000 |
| commit | 4cb52b0db78ef33bc2b135798880f98d8f9b6b65 (patch) | |
| tree | 7f405ef69e76e452f0100c7647c51ecb460bf13b /src | |
| parent | fix string size self-reference bug (diff) | |
| download | inkscape-4cb52b0db78ef33bc2b135798880f98d8f9b6b65.tar.gz inkscape-4cb52b0db78ef33bc2b135798880f98d8f9b6b65.zip | |
update 2geom
(bzr r4041)
Diffstat (limited to 'src')
| -rw-r--r-- | src/2geom/piecewise.h | 14 | ||||
| -rw-r--r-- | src/2geom/rect.h | 4 |
2 files changed, 9 insertions, 9 deletions
diff --git a/src/2geom/piecewise.h b/src/2geom/piecewise.h index 396811050..b4f000dc4 100644 --- a/src/2geom/piecewise.h +++ b/src/2geom/piecewise.h @@ -216,7 +216,7 @@ class Piecewise { template<typename T>
inline typename FragmentConcept<T>::BoundsType bounds_fast(const Piecewise<T> &f) {
boost::function_requires<FragmentConcept<T> >();
-
+
if(f.empty()) return typename FragmentConcept<T>::BoundsType();
typename FragmentConcept<T>::BoundsType ret(bounds_fast(f[0]));
for(unsigned i = 1; i < f.size(); i++)
@@ -227,7 +227,7 @@ inline typename FragmentConcept<T>::BoundsType bounds_fast(const Piecewise<T> &f template<typename T>
inline typename FragmentConcept<T>::BoundsType bounds_exact(const Piecewise<T> &f) {
boost::function_requires<FragmentConcept<T> >();
-
+
if(f.empty()) return typename FragmentConcept<T>::BoundsType();
typename FragmentConcept<T>::BoundsType ret(bounds_exact(f[0]));
for(unsigned i = 1; i < f.size(); i++)
@@ -238,20 +238,20 @@ inline typename FragmentConcept<T>::BoundsType bounds_exact(const Piecewise<T> & template<typename T>
inline typename FragmentConcept<T>::BoundsType bounds_local(const Piecewise<T> &f, const Interval &m) {
boost::function_requires<FragmentConcept<T> >();
-
+
if(f.empty()) return typename FragmentConcept<T>::BoundsType();
if(m.isEmpty()) return typename FragmentConcept<T>::BoundsType(f(m.min()));
-
+
unsigned fi = f.segN(m.min()), ti = f.segN(m.max());
double ft = f.segT(m.min(), fi), tt = f.segT(m.max(), ti);
-
+
if(fi == ti) return bounds_local(f[fi], Interval(ft, tt));
-
+
typename FragmentConcept<T>::BoundsType ret(bounds_local(f[fi], Interval(ft, 1.)));
for(unsigned i = fi + 1; i < ti; i++)
ret.unionWith(bounds_exact(f[i]));
if(tt != 0.) ret.unionWith(bounds_local(f[ti], Interval(0., tt)));
-
+
return ret;
}
diff --git a/src/2geom/rect.h b/src/2geom/rect.h index 6a6d979a4..86f9ec140 100644 --- a/src/2geom/rect.h +++ b/src/2geom/rect.h @@ -54,9 +54,9 @@ template<> class D2<Interval> { private: Interval f[2]; - D2<Interval>();// { f[X] = f[Y] = Interval(0, 0); } - public: + D2<Interval>() { f[X] = f[Y] = Interval(0, 0); } + D2<Interval>(Interval const &a, Interval const &b) { f[X] = a; f[Y] = b; |
