diff options
author | Cary Clark <caryclark@skia.org> | 2017-12-13 14:56:53 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-12-13 20:22:30 +0000 |
commit | 225825044d2d33e1833f2d49e8728d6cbc7bcd1c (patch) | |
tree | 006185ce1cad172e2e08e680252aede14a2a82ad /src/pathops | |
parent | c1ff9168c798559a0787483e7079141bdf1aa643 (diff) |
move divide by zero inside guard
speculative fix to see if this helps developer.
It's the right thing to do in any case.
TBR=reed@google.com
Change-Id: I4fa576a096a6188f290957a7f2fabe73668f142d
Reviewed-on: https://skia-review.googlesource.com/84521
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
Diffstat (limited to 'src/pathops')
-rw-r--r-- | src/pathops/SkDLineIntersection.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/pathops/SkDLineIntersection.cpp b/src/pathops/SkDLineIntersection.cpp index 5540c5c165..faca087235 100644 --- a/src/pathops/SkDLineIntersection.cpp +++ b/src/pathops/SkDLineIntersection.cpp @@ -47,13 +47,13 @@ int SkIntersections::intersectRay(const SkDLine& a, const SkDLine& b) { byLen * axLen - ayLen * bxLen == 0 ( == denom ) */ double denom = bLen.fY * aLen.fX - aLen.fY * bLen.fX; - SkDVector ab0 = a[0] - b[0]; - double numerA = ab0.fY * bLen.fX - bLen.fY * ab0.fX; - double numerB = ab0.fY * aLen.fX - aLen.fY * ab0.fX; - numerA /= denom; - numerB /= denom; int used; if (!approximately_zero(denom)) { + SkDVector ab0 = a[0] - b[0]; + double numerA = ab0.fY * bLen.fX - bLen.fY * ab0.fX; + double numerB = ab0.fY * aLen.fX - aLen.fY * ab0.fX; + numerA /= denom; + numerB /= denom; fT[0][0] = numerA; fT[1][0] = numerB; used = 1; |