Index: src/pathops/SkPathOpsTSect.h |
diff --git a/src/pathops/SkPathOpsTSect.h b/src/pathops/SkPathOpsTSect.h |
index bebdf40208cb25b7997c594d3f6ca7c1a6be3c4a..074fe376549b1fd60bc4e4669c52d3ba3d23ab2f 100644 |
--- a/src/pathops/SkPathOpsTSect.h |
+++ b/src/pathops/SkPathOpsTSect.h |
@@ -1467,11 +1467,17 @@ int SkTSect<TCurve, OppCurve>::linesIntersect(SkTSpan<TCurve, OppCurve>* span, |
workT += tStep; |
workPt = fCurve.ptAtT(workT); |
coinW.setPerp(fCurve, workT, workPt, opp->fCurve); |
+ if (coinW.perpT() < 0) { |
+ continue; |
+ } |
SkDVector perpW = workPt - coinW.perpPt(); |
if ((perpS.dot(perpW) >= 0) == (tStep < 0)) { |
tStep = -tStep; |
} |
- } while (!workPt.approximatelyEqual(coinW.perpPt())); |
+ if (workPt.approximatelyEqual(coinW.perpPt())) { |
+ break; |
+ } |
+ } while (true); |
double oppTTest = coinW.perpT(); |
if (!opp->fHead->contains(oppTTest)) { |
return 0; |