diff options
Diffstat (limited to 'src/effects/SkCornerPathEffect.cpp')
-rw-r--r-- | src/effects/SkCornerPathEffect.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/effects/SkCornerPathEffect.cpp b/src/effects/SkCornerPathEffect.cpp index 79d4c4cbd3..4b81f261fe 100644 --- a/src/effects/SkCornerPathEffect.cpp +++ b/src/effects/SkCornerPathEffect.cpp @@ -20,13 +20,12 @@ static bool ComputeStep(const SkPoint& a, const SkPoint& b, SkScalar radius, SkPoint* step) { SkScalar dist = SkPoint::Distance(a, b); - step->set(b.fX - a.fX, b.fY - a.fY); - + *step = b - a; if (dist <= radius * 2) { - step->scale(SK_ScalarHalf); + *step *= SK_ScalarHalf; return false; } else { - step->scale(SkScalarDiv(radius, dist)); + *step *= radius / dist; return true; } } @@ -47,6 +46,7 @@ bool SkCornerPathEffect::filterPath(SkPath* dst, const SkPath& src, bool prevIsValid = true; // to avoid warnings + step.set(0, 0); moveTo.set(0, 0); firstStep.set(0, 0); lastCorner.set(0, 0); |