summaryrefslogtreecommitdiff
path: root/src/location/declarativemaps/qdeclarativepolylinemapitem.cpp
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@qt.io>2018-03-07 13:14:45 +0100
committerPaolo Angelelli <paolo.angelelli@qt.io>2018-03-22 13:31:22 +0000
commitf0bc0db15ed262a8f31bb07b3b46a5cdf9277e79 (patch)
tree91aa9411980cf641de1f57aaac02e94e386b0ffc /src/location/declarativemaps/qdeclarativepolylinemapitem.cpp
parent1ced79ad7cc256eb82113e3419cb09926ceae9c3 (diff)
downloadqtlocation-f0bc0db15ed262a8f31bb07b3b46a5cdf9277e79.tar.gz
Fix MapPolyline QQuickItem geometry to allow enabling layers
The geometry now considers the line width, so that, when enabling layers, the item won't be incorrectly clipped at the borders. Task-number: QTBUG-38459 Change-Id: I82c1e49c914a4a1219bb1f1ec3a70ff7bfbfbcfe Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/location/declarativemaps/qdeclarativepolylinemapitem.cpp')
-rw-r--r--src/location/declarativemaps/qdeclarativepolylinemapitem.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/location/declarativemaps/qdeclarativepolylinemapitem.cpp b/src/location/declarativemaps/qdeclarativepolylinemapitem.cpp
index 3b004dce..9ef65188 100644
--- a/src/location/declarativemaps/qdeclarativepolylinemapitem.cpp
+++ b/src/location/declarativemaps/qdeclarativepolylinemapitem.cpp
@@ -407,7 +407,7 @@ void QGeoMapPolylineGeometry::updateScreenPoints(const QGeoMap &map,
}
screenBounds_ = bb;
- this->translate( -1 * sourceBounds_.topLeft());
+ this->translate( -1 * sourceBounds_.topLeft() + QPointF(strokeWidth, strokeWidth));
}
QDeclarativePolylineMapItem::QDeclarativePolylineMapItem(QQuickItem *parent)
@@ -763,8 +763,8 @@ void QDeclarativePolylineMapItem::updatePolish()
geometry_.updateSourcePoints(*map(), geopathProjected_, geopath_.boundingGeoRectangle().topLeft());
geometry_.updateScreenPoints(*map(), line_.width());
- setWidth(geometry_.sourceBoundingBox().width());
- setHeight(geometry_.sourceBoundingBox().height());
+ setWidth(geometry_.sourceBoundingBox().width() + 2 * line_.width());
+ setHeight(geometry_.sourceBoundingBox().height() + 2 * line_.width());
setPositionOnMap(geometry_.origin(), -1 * geometry_.sourceBoundingBox().topLeft());
}