summaryrefslogtreecommitdiffstats
path: root/src/2geom/piecewise.cpp
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2008-10-11 15:16:23 +0000
committerTed Gould <ted@canonical.com>2008-10-11 15:16:23 +0000
commit2f5eb047d9e05be5e68549ef6b75070d2faa7d2f (patch)
treeca2e94164b6d7aaebfc17196ca46bfc825a7665a /src/2geom/piecewise.cpp
parentMerge from trunk. (diff)
downloadinkscape-2f5eb047d9e05be5e68549ef6b75070d2faa7d2f.tar.gz
inkscape-2f5eb047d9e05be5e68549ef6b75070d2faa7d2f.zip
Merging from trunk
(bzr r6884)
Diffstat (limited to 'src/2geom/piecewise.cpp')
-rw-r--r--src/2geom/piecewise.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/2geom/piecewise.cpp b/src/2geom/piecewise.cpp
index 2d8638818..4c63b20df 100644
--- a/src/2geom/piecewise.cpp
+++ b/src/2geom/piecewise.cpp
@@ -158,7 +158,6 @@ std::vector<double> roots(Piecewise<SBasis> const &f){
std::vector<double> result;
for (unsigned i=0; i<f.size(); i++){
std::vector<double> rts=roots(f.segs[i]);
- rts=roots(f.segs[i]);
for (unsigned r=0; r<rts.size(); r++){
result.push_back(f.mapToDomain(rts[r], i));
@@ -167,6 +166,18 @@ std::vector<double> roots(Piecewise<SBasis> const &f){
return result;
}
+std::vector<std::vector<double> > multi_roots(Piecewise<SBasis> const &f, std::vector<double> const &values) {
+ std::vector<std::vector<double> > result(values.size());
+ for (unsigned i=0; i<f.size(); i++) {
+ std::vector<std::vector<double> > rts = multi_roots(f.segs[i], values);
+ for(unsigned j=0; j<rts.size(); j++) {
+ for(unsigned r=0; r<rts[j].size(); r++){
+ result[j].push_back(f.mapToDomain(rts[j][r], i));
+ }
+ }
+ }
+ return result;
+}
}
/*