From edefef351ab6a4772e976a6227d44fd8707cf207 Mon Sep 17 00:00:00 2001 From: Gellule Xg Date: Tue, 28 Jun 2011 21:00:22 -1000 Subject: 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 r10384.1.1) --- src/2geom/convex-cover.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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 -- cgit v1.2.3