diff options
Diffstat (limited to 'src/pathops/SkPathOpsCurve.h')
-rw-r--r-- | src/pathops/SkPathOpsCurve.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/pathops/SkPathOpsCurve.h b/src/pathops/SkPathOpsCurve.h index 2b50864e5b..7823146d78 100644 --- a/src/pathops/SkPathOpsCurve.h +++ b/src/pathops/SkPathOpsCurve.h @@ -358,12 +358,18 @@ static void (* const CurveDIntersectRay[])(const SkDCurve& , const SkDLine& , Sk }; static int line_intercept_h(const SkPoint a[2], SkScalar , SkScalar y, double* roots) { + if (a[0].fY == a[1].fY) { + return false; + } SkDLine line; roots[0] = SkIntersections::HorizontalIntercept(line.set(a), y); return between(0, roots[0], 1); } static int line_intercept_v(const SkPoint a[2], SkScalar , SkScalar x, double* roots) { + if (a[0].fX == a[1].fX) { + return false; + } SkDLine line; roots[0] = SkIntersections::VerticalIntercept(line.set(a), x); return between(0, roots[0], 1); |