shape ops work in progress
things work pretty well up to this point
it's time to apply recent deletion of binary code
algorithms to the unary code path
git-svn-id: http://skia.googlecode.com/svn/trunk@6788 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/experimental/Intersection/QuarticRoot.cpp b/experimental/Intersection/QuarticRoot.cpp
index 7a95b24..66ce3bf 100644
--- a/experimental/Intersection/QuarticRoot.cpp
+++ b/experimental/Intersection/QuarticRoot.cpp
@@ -46,9 +46,13 @@
/* normal form: x^2 + px + q = 0 */
const double p = B / (2 * A);
const double q = C / A;
- const double D = p * p - q;
+ double D = p * p - q;
if (D < 0) {
- return 0;
+ if (approximately_positive_squared(D)) {
+ D = 0;
+ } else {
+ return 0;
+ }
}
double sqrt_D = sqrt(D);
if (approximately_less_than_zero(sqrt_D)) {