summaryrefslogtreecommitdiff
path: root/src/positioning/qgeopath.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-06-07 11:06:28 +0200
committerLiang Qi <liang.qi@qt.io>2017-06-07 11:06:28 +0200
commitf55629245259ba7364e258f92408823024423caa (patch)
treef73063cf02dc175fbe9f0bfb48b3ddd686ea0f72 /src/positioning/qgeopath.cpp
parent22d980c8124026eb712f563326d5a5c1b180c671 (diff)
parentd89701c5c8646dedb0ebb2e011c4da796a6ae8a1 (diff)
downloadqtlocation-f55629245259ba7364e258f92408823024423caa.tar.gz
Merge remote-tracking branch 'origin/5.9' into dev
Conflicts: .qmake.conf src/plugins/geoservices/geoservices.pro Change-Id: Ie82dd22c588e5cba409fc1ef31a65968ce9f719b
Diffstat (limited to 'src/positioning/qgeopath.cpp')
-rw-r--r--src/positioning/qgeopath.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/positioning/qgeopath.cpp b/src/positioning/qgeopath.cpp
index 87f4a9d4..ad3536af 100644
--- a/src/positioning/qgeopath.cpp
+++ b/src/positioning/qgeopath.cpp
@@ -115,7 +115,8 @@ QGeoPath::QGeoPath()
}
/*!
- Constructs a new geo path from a list of coordinates.
+ Constructs a new geo path from a list of coordinates
+ (\a path and \a width).
*/
QGeoPath::QGeoPath(const QList<QGeoCoordinate> &path, const qreal &width)
: QGeoShape(new QGeoPathPrivate(path, width))
@@ -463,7 +464,7 @@ bool QGeoPathPrivate::contains(const QGeoCoordinate &coordinate) const
QDoubleVector2D candidate = ( (p-a).length() < (p-b).length() ) ? a : b;
- if (u < (b - a).length()
+ if (u > 0 && u < 1
&& (p-intersection).length() < (p-candidate).length() ) // And it falls in the segment
candidate = intersection;