diff options
author | Paolo Angelelli <paolo.angelelli@qt.io> | 2017-07-07 15:31:00 +0200 |
---|---|---|
committer | Paolo Angelelli <paolo.angelelli@qt.io> | 2017-07-17 12:40:42 +0000 |
commit | 2ab93acd9751b3ffe2c36a4a0e37dc792686a08f (patch) | |
tree | 59070747c2225f76754cf292e15ed29b30141d85 /src/location/declarativemaps/qdeclarativepolylinemapitem.cpp | |
parent | b02916a5568d57eda767ca930dcdb366179250bc (diff) | |
download | qtlocation-2ab93acd9751b3ffe2c36a4a0e37dc792686a08f.tar.gz |
Fix dragging items out of map bounds
In 5.9.0 map items are clipped against the visible region.
This implies that their geometry is also clipped against
the visible region.
This is problematic in ::geometryChanged, since the old
geometry is always clipped in this way.
This patch clips items against a "projectable" region
instead, that is the part of the map that is in front
of the camera.
Since this can produce very large vertices, mapbox
earcut 3rd party library is pulled in, to replace
qTriangulate that only supports coordinates up to
1<<21.
Task-number: QTBUG-61727
Change-Id: I7449e755a4848a2b2107c5de4e27821e3e887bfb
Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
Diffstat (limited to 'src/location/declarativemaps/qdeclarativepolylinemapitem.cpp')
-rw-r--r-- | src/location/declarativemaps/qdeclarativepolylinemapitem.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/location/declarativemaps/qdeclarativepolylinemapitem.cpp b/src/location/declarativemaps/qdeclarativepolylinemapitem.cpp index aedb9811..26f030b0 100644 --- a/src/location/declarativemaps/qdeclarativepolylinemapitem.cpp +++ b/src/location/declarativemaps/qdeclarativepolylinemapitem.cpp @@ -226,7 +226,7 @@ QList<QList<QDoubleVector2D> > QGeoMapPolylineGeometry::clipPath(const QGeoMap & // 2) QList<QList<QDoubleVector2D> > clippedPaths; - const QList<QDoubleVector2D> &visibleRegion = map.geoProjection().visibleRegion(); + const QList<QDoubleVector2D> &visibleRegion = map.geoProjection().projectableRegion(); if (visibleRegion.size()) { c2t::clip2tri clipper; clipper.addSubjectPath(QClipperUtils::qListToPath(wrappedPath), false); |