From 688fd0edd9d6149e3e02f2186e7590ca13c087d5 Mon Sep 17 00:00:00 2001 From: Matthias Rauter Date: Thu, 9 Mar 2023 15:02:52 +0100 Subject: 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. Pick-to: 6.5 Change-Id: I6707aede97082f7b1764cd7dd6bbe351baaad3da Reviewed-by: Volker Hilsheimer --- src/location/maps/qgeoprojection.cpp | 9 --------- src/location/quickmapitems/qdeclarativecirclemapitem.cpp | 9 +++++---- 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 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 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); -- cgit v1.2.1