From 81f626f062d95abe49fcb7d8f098e54646c04034 Mon Sep 17 00:00:00 2001 From: Paolo Angelelli Date: Wed, 9 Nov 2016 17:45:50 +0100 Subject: 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 --- src/imports/location/qdeclarativegeomap.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') 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: -- cgit v1.2.3