diff options
author | Paolo Angelelli <paolo.angelelli@qt.io> | 2016-11-09 17:45:50 +0100 |
---|---|---|
committer | Paolo Angelelli <paolo.angelelli@qt.io> | 2016-11-11 14:32:38 +0000 |
commit | 81f626f062d95abe49fcb7d8f098e54646c04034 (patch) | |
tree | 9b5dbac99a48e72e3482b7aa8800a539978d914f /src/imports | |
parent | c1755c75f8d54a27ff931a049d6fd9718c0be6bb (diff) | |
download | qtlocation-81f626f062d95abe49fcb7d8f098e54646c04034.tar.gz |
Fix for QDeclarativeGeoMap::fitViewportToGeoShape and QGeoRectangle
The current implementation fails to fit if the QGeoRectangle shape
crosses the dateline.
The problem does not happen with QGeoCircle.
This patch fixes the problem.
Change-Id: I043e9ff433f81a07f434112fe19449aec7ec94f6
Task-number: QTBUG-57027
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/imports')
-rw-r--r-- | src/imports/location/qdeclarativegeomap.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/imports/location/qdeclarativegeomap.cpp b/src/imports/location/qdeclarativegeomap.cpp index 7e8e1728..34697836 100644 --- a/src/imports/location/qdeclarativegeomap.cpp +++ b/src/imports/location/qdeclarativegeomap.cpp @@ -810,6 +810,9 @@ void QDeclarativeGeoMap::fitViewportToGeoShape() QGeoRectangle rect = m_region; topLeft = rect.topLeft(); bottomRight = rect.bottomRight(); + if (bottomRight.longitude() < topLeft.longitude()) + bottomRight.setLongitude(bottomRight.longitude() + 360.0); + break; } case QGeoShape::CircleType: |