shape ops work in progress
good checkpoint: nearly all tests pass solidly here
git-svn-id: http://skia.googlecode.com/svn/trunk@7420 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/experimental/Intersection/QuadraticUtilities.cpp b/experimental/Intersection/QuadraticUtilities.cpp
index c1fab05..d8755a3 100644
--- a/experimental/Intersection/QuadraticUtilities.cpp
+++ b/experimental/Intersection/QuadraticUtilities.cpp
@@ -97,7 +97,9 @@
// unlike quadratic roots, this does not discard real roots <= 0 or >= 1
int quadraticRootsReal(const double A, const double B, const double C, double s[2]) {
- if (approximately_zero(A)) {
+ const double p = B / (2 * A);
+ const double q = C / A;
+ if (approximately_zero(A) && (approximately_zero_inverse(p) || approximately_zero_inverse(q))) {
if (approximately_zero(B)) {
s[0] = 0;
return C == 0;
@@ -106,8 +108,6 @@
return 1;
}
/* normal form: x^2 + px + q = 0 */
- const double p = B / (2 * A);
- const double q = C / A;
const double p2 = p * p;
#if 0
double D = AlmostEqualUlps(p2, q) ? 0 : p2 - q;