Index: src/pathops/SkPathOpsPoint.h |
=================================================================== |
--- src/pathops/SkPathOpsPoint.h (revision 9425) |
+++ src/pathops/SkPathOpsPoint.h (working copy) |
@@ -117,8 +117,8 @@ |
return true; |
} |
double inv = 1 / denom; |
- return approximately_equal(fX * inv, a.fX * inv) |
- && approximately_equal(fY * inv, a.fY * inv); |
+ return approximately_equal_double(fX * inv, a.fX * inv) |
+ && approximately_equal_double(fY * inv, a.fY * inv); |
} |
bool approximatelyEqualHalf(const SkDPoint& a) const { |
@@ -151,6 +151,13 @@ |
return temp.lengthSquared(); |
} |
+ static SkDPoint Mid(const SkDPoint& a, const SkDPoint& b) { |
+ SkDPoint result; |
+ result.fX = (a.fX + b.fX) / 2; |
+ result.fY = (a.fY + b.fY) / 2; |
+ return result; |
+ } |
+ |
double moreRoughlyEqual(const SkDPoint& a) const { |
return more_roughly_equal(a.fY, fY) && more_roughly_equal(a.fX, fX); |
} |