Fix is_convex() check for inset polys.
authorJim Van Verth <jvanverth@google.com>
Wed, 29 Mar 2017 18:37:28 +0000 (14:37 -0400)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Wed, 29 Mar 2017 19:32:34 +0000 (19:32 +0000)
Change-Id: I1a8a24132b0cf9eb80dd586bf2f1b930adb7b582
Reviewed-on: https://skia-review.googlesource.com/10525
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>

src/utils/SkInsetConvexPolygon.cpp
tests/InsetConvexPolyTest.cpp

index e4b5249..93bbae9 100755 (executable)
@@ -125,8 +125,7 @@ static bool is_convex(const SkTDArray<SkPoint>& poly) {
         SkVector v0 = poly[j] - poly[i];
         SkVector v1 = poly[k] - poly[i];
         SkScalar perpDot = v0.cross(v1);
-        int side = winding*perpDot;
-        if (side < 0) {
+        if (winding*perpDot < 0) {
             return false;
         }
     }
index e13a25a..5376789 100644 (file)
@@ -23,8 +23,7 @@ static bool is_convex(const SkTDArray<SkPoint>& poly) {
         SkVector v0 = poly[j] - poly[i];
         SkVector v1 = poly[k] - poly[i];
         SkScalar perpDot = v0.cross(v1);
-        int side = winding*perpDot;
-        if (side < 0) {
+        if (winding*perpDot < 0) {
             return false;
         }
     }