summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@qt.io>2016-11-09 17:45:50 +0100
committerPaolo Angelelli <paolo.angelelli@qt.io>2016-11-11 14:32:38 +0000
commit81f626f062d95abe49fcb7d8f098e54646c04034 (patch)
tree9b5dbac99a48e72e3482b7aa8800a539978d914f
parentc1755c75f8d54a27ff931a049d6fd9718c0be6bb (diff)
downloadqtlocation-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>
-rw-r--r--src/imports/location/qdeclarativegeomap.cpp3
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: