diff options
author | Paolo Angelelli <paolo.angelelli@qt.io> | 2017-08-04 13:22:43 +0200 |
---|---|---|
committer | Paolo Angelelli <paolo.angelelli@qt.io> | 2017-08-09 14:16:46 +0000 |
commit | 602cd4845dff2bbe5a8118899f1dfbcca9d614f1 (patch) | |
tree | a2e6c52c7d3982d883e6643a798b4c483c30b3d3 /src/positioning/qlocationutils_p.h | |
parent | b6294cfca675bd5aa9a34e15c93692a0f1b8fdb2 (diff) | |
download | qtlocation-602cd4845dff2bbe5a8118899f1dfbcca9d614f1.tar.gz |
Fix visible region computation in QGeoProjectionWebMercator
Currently the visible region is calculated as the intersection between
the viewing frustum and the map plane clipped against the map extended
rectangle in mercator space (from -1 to 2 in x coords, 0 to 1 in y
coords).
The result is correct in the extended mercator space. However, this may
lead to overlapping coordinates when converted back to latitude and
longitude.
For this reason, this patch changes the clipping geometry to be the
map un-extended rectangle centered around the current map center.
The result is a geometry that never wraps around or overlaps, thus
removing the need for handling separately the case when the map
is fully visible when returning the visible region.
Task-number: QTBUG-57690
Change-Id: I8396c40a123ce94bff4388dfefbd8a694657b8bd
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Diffstat (limited to 'src/positioning/qlocationutils_p.h')
-rw-r--r-- | src/positioning/qlocationutils_p.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/positioning/qlocationutils_p.h b/src/positioning/qlocationutils_p.h index 75c4b7f4..69cf0fee 100644 --- a/src/positioning/qlocationutils_p.h +++ b/src/positioning/qlocationutils_p.h @@ -55,7 +55,7 @@ #include <qmath.h> #include <QtPositioning/QGeoCoordinate> -static const double offsetEpsilon = 0.0000000000001; +static const double offsetEpsilon = 1e-12; // = 0.000000000001 static const double leftOffset = -180.0 + offsetEpsilon; static const double rightOffset = 180.0 - offsetEpsilon; |