summaryrefslogtreecommitdiff
path: root/src/mbgl/util/geometry_within.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/util/geometry_within.cpp')
-rw-r--r--src/mbgl/util/geometry_within.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mbgl/util/geometry_within.cpp b/src/mbgl/util/geometry_within.cpp
index 28a53c8ebc..89e3d84fc6 100644
--- a/src/mbgl/util/geometry_within.cpp
+++ b/src/mbgl/util/geometry_within.cpp
@@ -47,7 +47,11 @@ bool lineIntersectLine(const Point<int64_t>& a,
y2 = p2.y - q1.y;
x3 = q2.x - q1.x;
y3 = q2.y - q1.y;
- if ((x1 * y3 - x3 * y1) * (x2 * y3 - x3 * y2) < 0) return true;
+ auto ret1 = (x1 * y3 - x3 * y1);
+ auto ret2 = (x2 * y3 - x3 * y2);
+ if ((ret1 > 0 && ret2 < 0) || (ret1 < 0 && ret2 > 0)) {
+ return true;
+ }
return false;
};