summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron McCarthy <aaron.mccarthy@jollamobile.com>2015-06-19 15:08:41 +1000
committerAaron McCarthy <mccarthy.aaron@gmail.com>2015-06-26 06:46:31 +0000
commit95c58d6eb5a5557ca2f2be3d54f267c648f62731 (patch)
tree9fd4df75c26cbd25d5e5baca17142d482da9d934
parent55483227f811898ef97ce408145a028231afbbf2 (diff)
downloadqtlocation-95c58d6eb5a5557ca2f2be3d54f267c648f62731.tar.gz
Make use of qBound
Change-Id: Ia6859fa30118f29d6074d4ffed9e22023f75cc3b Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
-rw-r--r--src/positioning/qgeoprojection.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/positioning/qgeoprojection.cpp b/src/positioning/qgeoprojection.cpp
index 0d3543e4..a2e087b0 100644
--- a/src/positioning/qgeoprojection.cpp
+++ b/src/positioning/qgeoprojection.cpp
@@ -51,8 +51,7 @@ QDoubleVector2D QGeoProjection::coordToMercator(const QGeoCoordinate &coord)
double lat = coord.latitude();
lat = 0.5 - (std::log(std::tan((pi / 4.0) + (pi / 2.0) * lat / 180.0)) / pi) / 2.0;
- lat = qMax(0.0, lat);
- lat = qMin(1.0, lat);
+ lat = qBound(0.0, lat, 1.0);
return QDoubleVector2D(lon, lat);
}