aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pathops/SkDLineIntersection.cpp
diff options
context:
space:
mode:
authorGravatar caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-04-18 15:58:21 +0000
committerGravatar caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-04-18 15:58:21 +0000
commit0361032c0b53401030a720bc8b4930c3ec59f19e (patch)
tree9bb66d560604ef23c9d015c10d6d73fece0928e7 /src/pathops/SkDLineIntersection.cpp
parentf707adc4f8b22fd1a59a900b64333480de653c5b (diff)
path ops work in progress
fix bugs in tests on 32 bit release Most changes revolve around pinning computed t values very close to zero and one. git-svn-id: http://skia.googlecode.com/svn/trunk@8745 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/pathops/SkDLineIntersection.cpp')
-rw-r--r--src/pathops/SkDLineIntersection.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/pathops/SkDLineIntersection.cpp b/src/pathops/SkDLineIntersection.cpp
index 8b02030fa6..93f0353048 100644
--- a/src/pathops/SkDLineIntersection.cpp
+++ b/src/pathops/SkDLineIntersection.cpp
@@ -158,7 +158,7 @@ int SkIntersections::horizontal(const SkDLine& line, double left, double right,
return result;
}
double xIntercept = line[0].fX + fT[0][0] * (line[1].fX - line[0].fX);
- if (xIntercept > right || xIntercept < left) {
+ if (!precisely_between(left, xIntercept, right)) {
return fUsed = 0;
}
return result;
@@ -172,7 +172,7 @@ int SkIntersections::horizontal(const SkDLine& line, double left, double right,
break;
case 1: {
double xIntercept = line[0].fX + fT[0][0] * (line[1].fX - line[0].fX);
- if (xIntercept > right || xIntercept < left) {
+ if (!precisely_between(left, xIntercept, right)) {
return fUsed = 0;
}
fT[1][0] = (xIntercept - left) / (right - left);
@@ -213,7 +213,7 @@ int SkIntersections::vertical(const SkDLine& line, double x) {
if (min > max) {
SkTSwap(min, max);
}
- if (min > x || max < x) {
+ if (!precisely_between(min, x, max)) {
return fUsed = 0;
}
if (AlmostEqualUlps(min, max)) {
@@ -233,7 +233,7 @@ int SkIntersections::vertical(const SkDLine& line, double top, double bottom,
break;
case 1: {
double yIntercept = line[0].fY + fT[0][0] * (line[1].fY - line[0].fY);
- if (yIntercept > bottom || yIntercept < top) {
+ if (!precisely_between(top, yIntercept, bottom)) {
return fUsed = 0;
}
fT[1][0] = (yIntercept - top) / (bottom - top);