summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Rauter <matthias.rauter@qt.io>2023-03-09 15:02:52 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-03-23 19:52:43 +0000
commit932567d16c85af6a6e3a9107f394e63df0f11dbb (patch)
treef0ffd8ff43ae9720a908af8cc2f3d2acb342c878
parent399d9798bcf03d507a5ab653e25ae5c8529e96ea (diff)
downloadqtlocation-932567d16c85af6a6e3a9107f394e63df0f11dbb.tar.gz
Remove ugly line at the bottom of the map
Mapitems that extend below 85 deg South show a black line at the bottom of the map. The cause for this line is too narrow clipping and point insertion which is removed with this change. Change-Id: I6707aede97082f7b1764cd7dd6bbe351baaad3da Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 688fd0edd9d6149e3e02f2186e7590ca13c087d5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/location/maps/qgeoprojection.cpp9
-rw-r--r--src/location/quickmapitems/qdeclarativecirclemapitem.cpp9
2 files changed, 5 insertions, 13 deletions
diff --git a/src/location/maps/qgeoprojection.cpp b/src/location/maps/qgeoprojection.cpp
index 3e5ea2ef..8f1e7d82 100644
--- a/src/location/maps/qgeoprojection.cpp
+++ b/src/location/maps/qgeoprojection.cpp
@@ -808,15 +808,6 @@ void QGeoProjectionWebMercator::updateVisibleRegion()
m_visibleRegionExpanded.push_back(centroid + vc * 1.2); // fixing expansion factor to 1.2
}
- QClipperUtils clipperExpanded;
- clipperExpanded.clearClipper();
- clipperExpanded.addSubjectPath(m_visibleRegionExpanded, true);
- clipperExpanded.addClipPolygon(m_projectableRegion);
- const auto resVisibleExpanded = clipperExpanded.execute(QClipperUtils::Intersection);
- if (resVisibleExpanded.size())
- m_visibleRegionExpanded = resVisibleExpanded[0]; // Intersection between two convex quadrilaterals should always be a single polygon
- else
- m_visibleRegionExpanded = m_visibleRegion;
}
QGeoCameraData QGeoProjectionWebMercator::cameraData() const
diff --git a/src/location/quickmapitems/qdeclarativecirclemapitem.cpp b/src/location/quickmapitems/qdeclarativecirclemapitem.cpp
index e01b724e..7cf69e59 100644
--- a/src/location/quickmapitems/qdeclarativecirclemapitem.cpp
+++ b/src/location/quickmapitems/qdeclarativecirclemapitem.cpp
@@ -371,7 +371,7 @@ void QDeclarativeCircleMapItemPrivate::includeOnePoleInPath(QList<QDoubleVector2
[](const QDoubleVector2D &a, const QDoubleVector2D &b) -> bool
{return a.x() < b.x();});
- const qreal newPoleLat = crossNorthPole ? 0.0 : 1.0;
+ const qreal newPoleLat = crossNorthPole ? -0.1 : 1.1;
const QDoubleVector2D P1 = path.first() + QDoubleVector2D(1.0, 0.0);
const QDoubleVector2D P2 = path.last() - QDoubleVector2D(1.0, 0.0);
path.push_front(P2);
@@ -478,13 +478,14 @@ void QDeclarativeCircleMapItemPrivateCPU::updatePolish()
QGeoMapPolygonGeometry::MapBorderBehaviour wrappingMode = QGeoMapPolygonGeometry::DrawOnce;
QList<QDoubleVector2D> surroundingRect;
if (cameraRect.contains(circleRect)){
- cameraRect = cameraRect.adjusted(-0.1, 0.0, 0.2, 0.0);
+ cameraRect = cameraRect.adjusted(-0.1, -0.1, 0.2, 0.2);
surroundingRect = {{cameraRect.left(), cameraRect.top()}, {cameraRect.right(), cameraRect.top()},
{cameraRect.right(), cameraRect.bottom()}, {cameraRect.left() , cameraRect.bottom()}};
} else {
const qreal anchorRect = centerX;
- surroundingRect = {{anchorRect, 0.0}, {anchorRect + 1.0, 0.0},
- {anchorRect + 1.0, 1.0}, {anchorRect, 1.0}};
+
+ surroundingRect = {{anchorRect, -0.1}, {anchorRect + 1.0, -0.1},
+ {anchorRect + 1.0, 1.1}, {anchorRect, 1.1}};
wrappingMode = QGeoMapPolygonGeometry::WrapAround;
}
m_geometry.updateSourcePoints(*m_circle.map(), {surroundingRect, circlePath}, wrappingMode);