Index: src/pathops/SkDCubicLineIntersection.cpp |
diff --git a/src/pathops/SkDCubicLineIntersection.cpp b/src/pathops/SkDCubicLineIntersection.cpp |
index cbdce7789a800964d699393c0ec8d29f1b2951f5..b80b406e446eff923e5724638447032c14370085 100644 |
--- a/src/pathops/SkDCubicLineIntersection.cpp |
+++ b/src/pathops/SkDCubicLineIntersection.cpp |
@@ -6,6 +6,7 @@ |
*/ |
#include "SkIntersections.h" |
#include "SkPathOpsCubic.h" |
+#include "SkPathOpsCurve.h" |
#include "SkPathOpsLine.h" |
/* |
@@ -291,6 +292,22 @@ public: |
} |
fIntersections->insert(cubicT, lineT, fCubic[cIndex]); |
} |
+ addLineNearEndPoints(); |
+ } |
+ |
+ void addLineNearEndPoints() { |
+ for (int lIndex = 0; lIndex < 2; ++lIndex) { |
+ double lineT = (double) lIndex; |
+ if (fIntersections->hasOppT(lineT)) { |
+ continue; |
+ } |
+ double cubicT = ((SkDCurve*) &fCubic)->nearPoint(SkPath::kCubic_Verb, |
+ fLine[lIndex], fLine[!lIndex]); |
+ if (cubicT < 0) { |
+ continue; |
+ } |
+ fIntersections->insert(cubicT, lineT, fLine[lIndex]); |
+ } |
} |
void addExactHorizontalEndPoints(double left, double right, double y) { |
@@ -316,7 +333,7 @@ public: |
} |
fIntersections->insert(cubicT, lineT, fCubic[cIndex]); |
} |
- // FIXME: see if line end is nearly on cubic |
+ addLineNearEndPoints(); |
herb_g
2016/07/18 15:13:39
this->
caryclark
2016/07/18 15:55:49
Done.
|
} |
void addExactVerticalEndPoints(double top, double bottom, double x) { |
@@ -342,7 +359,7 @@ public: |
} |
fIntersections->insert(cubicT, lineT, fCubic[cIndex]); |
} |
- // FIXME: see if line end is nearly on cubic |
+ addLineNearEndPoints(); |
} |
double findLineT(double t) { |