work in progress
git-svn-id: http://skia.googlecode.com/svn/trunk@3702 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/experimental/Intersection/QuadraticUtilities.cpp b/experimental/Intersection/QuadraticUtilities.cpp
index 51a7569..ea4cd85 100644
--- a/experimental/Intersection/QuadraticUtilities.cpp
+++ b/experimental/Intersection/QuadraticUtilities.cpp
@@ -9,12 +9,19 @@
}
double squareRt = sqrt(square);
double Q = (B + (B < 0 ? -squareRt : squareRt)) / -2;
+ double ratio;
int foundRoots = 0;
if ((Q <= A) ^ (Q < 0)) {
- t[foundRoots++] = Q / A;
+ ratio = Q / A;
+ if (!isnan(ratio)) {
+ t[foundRoots++] = ratio;
+ }
}
if ((C <= Q) ^ (C < 0)) {
- t[foundRoots++] = C / Q;
+ ratio = C / Q;
+ if (!isnan(ratio)) {
+ t[foundRoots++] = ratio;
+ }
}
return foundRoots;
}