diff options
author | caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-01-25 18:57:23 +0000 |
---|---|---|
committer | caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-01-25 18:57:23 +0000 |
commit | 27accef223a27fba437f5e825d99edbae20a045b (patch) | |
tree | bba808edd5117406ec3d17f08baebdbbd4338a1a /experimental/Intersection/QuadraticBezierClip.cpp | |
parent | 76bd2540b55f31c8e72adb2fa72a88d7f4ba5374 (diff) |
Intersection work in progress
Review URL: https://codereview.appspot.com/5576043
git-svn-id: http://skia.googlecode.com/svn/trunk@3087 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'experimental/Intersection/QuadraticBezierClip.cpp')
-rw-r--r-- | experimental/Intersection/QuadraticBezierClip.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/experimental/Intersection/QuadraticBezierClip.cpp b/experimental/Intersection/QuadraticBezierClip.cpp index 1114d74398..fc3acfe06b 100644 --- a/experimental/Intersection/QuadraticBezierClip.cpp +++ b/experimental/Intersection/QuadraticBezierClip.cpp @@ -48,10 +48,14 @@ bool bezier_clip(const Quadratic& q1, const Quadratic& q2, double& minT, double& maxT = 1; } // Find the intersection of distance convex hull and fat line. - x_at(distance2y[0], distance2y[1], top, bottom, flags, minT, maxT); - x_at(distance2y[1], distance2y[2], top, bottom, flags, minT, maxT); - x_at(distance2y[2], distance2y[0], top, bottom, flags, minT, maxT); - + int idx = 0; + do { + int next = idx + 1; + if (next == 3) { + next = 0; + } + x_at(distance2y[idx], distance2y[next], top, bottom, flags, minT, maxT); + idx = next; + } while (idx); return minT < maxT; // returns false if distance shows no intersection } - |