Index: src/core/SkPath.cpp |
diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp |
index 4af2dad5262c97fa15e1717eabd93debfeaa718f..6927bedeab5ff7ff66d067977a3c602e94d57b50 100644 |
--- a/src/core/SkPath.cpp |
+++ b/src/core/SkPath.cpp |
@@ -1293,13 +1293,16 @@ void SkPath::arcTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar |
return; |
} |
- SkScalar dist = SkScalarMulDiv(radius, SK_Scalar1 - cosh, sinh); |
- if (dist < 0) { |
- dist = -dist; |
- } |
+ SkScalar dist = SkScalarAbs(SkScalarMulDiv(radius, SK_Scalar1 - cosh, sinh)); |
SkScalar xx = x1 - SkScalarMul(dist, before.fX); |
SkScalar yy = y1 - SkScalarMul(dist, before.fY); |
+#ifndef SK_SUPPORT_LEGACY_ARCTO |
+ after.setLength(dist); |
+ this->lineTo(xx, yy); |
+ SkScalar weight = SkScalarSqrt(SK_ScalarHalf + cosh * SK_ScalarHalf); |
+ this->conicTo(x1, y1, x1 + after.fX, y1 + after.fY, weight); |
+#else |
SkRotationDirection arcDir; |
// now turn before/after into normals |
@@ -1328,6 +1331,7 @@ void SkPath::arcTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar |
for (int i = 1; i < count; i += 2) { |
this->quadTo(pts[i], pts[i+1]); |
} |
+#endif |
} |
/////////////////////////////////////////////////////////////////////////////// |