summaryrefslogtreecommitdiffstats
path: root/src/live_effects/lpe-knot.cpp
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-07-13 20:16:51 +0000
committerTed Gould <ted@gould.cx>2010-07-13 20:16:51 +0000
commitef2d72d29fce61231bdd7888ab8330503158e9d6 (patch)
tree4685bfddef010181fdd87fc182016b994f2b69d9 /src/live_effects/lpe-knot.cpp
parentPulling in a more recent trunk (diff)
parentTranslations. Romanian nsh file update. (diff)
downloadinkscape-ef2d72d29fce61231bdd7888ab8330503158e9d6.tar.gz
inkscape-ef2d72d29fce61231bdd7888ab8330503158e9d6.zip
Upgrading to trunk
(bzr r8254.1.57)
Diffstat (limited to 'src/live_effects/lpe-knot.cpp')
-rw-r--r--src/live_effects/lpe-knot.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/live_effects/lpe-knot.cpp b/src/live_effects/lpe-knot.cpp
index b3aa2df45..b8e9b8cf9 100644
--- a/src/live_effects/lpe-knot.cpp
+++ b/src/live_effects/lpe-knot.cpp
@@ -56,17 +56,19 @@ public:
static
std::vector<Geom::Interval> complementOf(Geom::Interval I, std::vector<Geom::Interval> domain){
std::vector<Geom::Interval> ret;
- double min = domain.front().min();
- double max = domain.back().max();
- Geom::Interval I1 = Geom::Interval(min,I.min());
- Geom::Interval I2 = Geom::Interval(I.max(),max);
-
- for (unsigned i = 0; i<domain.size(); i++){
- boost::optional<Geom::Interval> I1i = intersect(domain.at(i),I1);
- if (I1i && !I1i->isSingular()) ret.push_back(I1i.get());
- boost::optional<Geom::Interval> I2i = intersect(domain.at(i),I2);
- if (I2i && !I2i->isSingular()) ret.push_back(I2i.get());
- }
+ if (!domain.empty()) {
+ double min = domain.front().min();
+ double max = domain.back().max();
+ Geom::Interval I1 = Geom::Interval(min,I.min());
+ Geom::Interval I2 = Geom::Interval(I.max(),max);
+
+ for (unsigned i = 0; i<domain.size(); i++){
+ boost::optional<Geom::Interval> I1i = intersect(domain.at(i),I1);
+ if (I1i && !I1i->isSingular()) ret.push_back(I1i.get());
+ boost::optional<Geom::Interval> I2i = intersect(domain.at(i),I2);
+ if (I2i && !I2i->isSingular()) ret.push_back(I2i.get());
+ }
+ }
return ret;
}