summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGellule Xg <gellule.xg@gmail.com>2011-06-29 07:01:53 +0000
committerGellule Xg <gellule.xg@gmail.com>2011-06-29 07:01:53 +0000
commite1b5613da4c17995aac75c318eaeb7e91ff11de7 (patch)
tree1537dea7a94224dfa67903566833f104aca251fc /src
parentReplaced a 'reshow_with_initial_size' by a simple 'resize', to address what l... (diff)
parentAs the comment says testing for a float to be equal to zero is not safe, henc... (diff)
downloadinkscape-e1b5613da4c17995aac75c318eaeb7e91ff11de7.tar.gz
inkscape-e1b5613da4c17995aac75c318eaeb7e91ff11de7.zip
As the comment says testing for a float to be equal to zero is not safe, hence the use of an ad-hoc epsilon instead. This was causing a crash with connectors where the size of the convex would change depending on calculation accuracy. This fixes part c) of bug #640985.
(bzr r10385)
Diffstat (limited to 'src')
-rw-r--r--src/2geom/convex-cover.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/2geom/convex-cover.cpp b/src/2geom/convex-cover.cpp
index 21a5c3107..d50accadf 100644
--- a/src/2geom/convex-cover.cpp
+++ b/src/2geom/convex-cover.cpp
@@ -145,7 +145,7 @@ ConvexHull::graham_scan() {
double o = SignedTriangleArea(boundary[stac-2],
boundary[stac-1],
boundary[i]);
- if(o == 0) { // colinear - dangerous...
+ if(fabs(o) < 1e-8) { // colinear - dangerous...
stac--;
} else if(o < 0) { // anticlockwise
} else { // remove concavity