aboutsummaryrefslogtreecommitdiffhomepage
path: root/experimental
diff options
context:
space:
mode:
authorGravatar caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-06-06 11:52:28 +0000
committerGravatar caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-06-06 11:52:28 +0000
commit06c279e42a9c69de8d5e8a4a59537422e074a79e (patch)
treed544f00c1127065c32fb9baf459bcac48e52b538 /experimental
parent411dad0630913fc07f2412b4be17acfbfd914fbc (diff)
shape ops work in progress
git-svn-id: http://skia.googlecode.com/svn/trunk@4174 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'experimental')
-rw-r--r--experimental/Intersection/Simplify.cpp12
-rw-r--r--experimental/Intersection/SimplifyNew_Test.cpp2
2 files changed, 7 insertions, 7 deletions
diff --git a/experimental/Intersection/Simplify.cpp b/experimental/Intersection/Simplify.cpp
index f3c095e266..0efe02a7c2 100644
--- a/experimental/Intersection/Simplify.cpp
+++ b/experimental/Intersection/Simplify.cpp
@@ -1063,17 +1063,17 @@ finish:
int firstT = 0;
int lastT = 0;
int firstCoinT = 0;
- SkScalar topY = fPts[0].fY;
+ SkPoint topPt = fPts[0];
int count = fTs.count();
int index;
for (index = 1; index < count; ++index) {
const Span& span = fTs[index];
- double t = span.fT;
- SkScalar yIntercept = t == 1 ? fPts[fVerb].fY : yAtT(t);
- if (topY > yIntercept) {
- topY = yIntercept;
+ const SkPoint& intercept = xyAtT(&span);
+ if (topPt.fY > intercept.fY || (topPt.fY == intercept.fY
+ && topPt.fX > intercept.fX)) {
+ topPt = intercept;
firstT = lastT = firstCoinT = index;
- } else if (topY == yIntercept) {
+ } else if (topPt == intercept) {
lastT = index;
if (span.fCoincident) {
firstCoinT = index;
diff --git a/experimental/Intersection/SimplifyNew_Test.cpp b/experimental/Intersection/SimplifyNew_Test.cpp
index 9098f69fa2..3ce8f05cf6 100644
--- a/experimental/Intersection/SimplifyNew_Test.cpp
+++ b/experimental/Intersection/SimplifyNew_Test.cpp
@@ -104,7 +104,7 @@ static void (*tests[])() = {
static const size_t testCount = sizeof(tests) / sizeof(tests[0]);
-static void (*firstTest)() = 0;
+static void (*firstTest)() = testLine5;
static bool skipAll = false;
void SimplifyNew_Test() {