summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Rauter <matthias.rauter@qt.io>2023-03-09 15:02:52 +0100
committerMatthias Rauter <matthias.rauter@qt.io>2023-03-23 20:15:56 +0100
commit688fd0edd9d6149e3e02f2186e7590ca13c087d5 (patch)
treeec572eade7cccb24cb7f7cc37a5a4bf7cb566ea4
parentbe398355075d5b793805f75911849cd68e48a2b0 (diff)
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 <volker.hilsheimer@qt.io>
-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);