summaryrefslogtreecommitdiffstats
path: root/src/2geom/sbasis-roots.cpp
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2015-08-13 15:48:12 +0000
committerKrzysztof KosiƄski <tweenk.pl@gmail.com>2015-08-13 15:48:12 +0000
commit9616befcd379cc7173356998ff4c7b055b21e361 (patch)
treeec1fe99e0fc5ee450c99b08bf28c778f85fcfce1 /src/2geom/sbasis-roots.cpp
parentFix bug in Maithili .po file. (diff)
downloadinkscape-9616befcd379cc7173356998ff4c7b055b21e361.tar.gz
inkscape-9616befcd379cc7173356998ff4c7b055b21e361.zip
2Geom: update to r2422.
Fixes LP #1482806: crash on Pattern along Path with horizontal segments. This was caused by empty SBasis objects. After the changes in 2Geom, empty SBasis objects should no longer be created. Fixed bugs: - https://launchpad.net/bugs/1482806 (bzr r14299)
Diffstat (limited to 'src/2geom/sbasis-roots.cpp')
-rw-r--r--src/2geom/sbasis-roots.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/2geom/sbasis-roots.cpp b/src/2geom/sbasis-roots.cpp
index 57bef4c0f..e3e5e4441 100644
--- a/src/2geom/sbasis-roots.cpp
+++ b/src/2geom/sbasis-roots.cpp
@@ -222,7 +222,7 @@ static void multi_roots_internal(SBasis const &f,
double b,
double fb){
- if (f.size()==0){
+ if (f.isZero(0)){
int idx;
idx=upper_level(levels,0,vtol);
if (idx<(int)levels.size()&&fabs(levels.at(idx))<=vtol){
@@ -414,7 +414,7 @@ static void level_sets_internal(SBasis const &f,
double fb,
double tol=1e-5){
- if (f.size()==0){
+ if (f.isZero(0)){
unsigned idx;
idx=upper_level( levels, 0. );
if (idx<levels.size() && levels[idx].contains(0.)){
@@ -614,6 +614,7 @@ std::vector<double> roots1(SBasis const & s, Interval const ivl) {
std::vector<double> roots(SBasis const & s) {
switch(s.size()) {
case 0:
+ assert(false);
return std::vector<double>();
case 1:
return roots1(s);
@@ -628,6 +629,7 @@ std::vector<double> roots(SBasis const & s) {
std::vector<double> roots(SBasis const & s, Interval const ivl) {
switch(s.size()) {
case 0:
+ assert(false);
return std::vector<double>();
case 1:
return roots1(s, ivl);