diff options
author | Paolo Angelelli <paolo.angelelli@qt.io> | 2018-04-17 13:31:54 +0200 |
---|---|---|
committer | Paolo Angelelli <paolo.angelelli@qt.io> | 2018-04-19 11:45:58 +0000 |
commit | ecc8182f6c6c8b1448a35de46c3f5598bbf35150 (patch) | |
tree | a20d08677dd7365b2eb61ddf9307d160d2277928 /src/location/declarativemaps/qdeclarativepolylinemapitem.cpp | |
parent | f9b9f578f6e7e1ba572a7f098d53d3a0b0fd4a97 (diff) | |
download | qtlocation-ecc8182f6c6c8b1448a35de46c3f5598bbf35150.tar.gz |
Fix MapPolyline being drawn misplaced and moving when clipped
Regression introduced in f0bc0db15ed262a8f31bb07b3b46a5cdf9277e79
Change-Id: I4c4a3cb2302daeb825be21f9e2f6c235d2cb7c93
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/location/declarativemaps/qdeclarativepolylinemapitem.cpp')
-rw-r--r-- | src/location/declarativemaps/qdeclarativepolylinemapitem.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/location/declarativemaps/qdeclarativepolylinemapitem.cpp b/src/location/declarativemaps/qdeclarativepolylinemapitem.cpp index 44f9b3a1..2f045121 100644 --- a/src/location/declarativemaps/qdeclarativepolylinemapitem.cpp +++ b/src/location/declarativemaps/qdeclarativepolylinemapitem.cpp @@ -519,7 +519,8 @@ void QGeoMapPolylineGeometry::updateSourcePoints(const QGeoMap &map, \internal */ void QGeoMapPolylineGeometry::updateScreenPoints(const QGeoMap &map, - qreal strokeWidth) + qreal strokeWidth, + bool adjustTranslation) { if (!screenDirty_) return; @@ -583,7 +584,8 @@ void QGeoMapPolylineGeometry::updateScreenPoints(const QGeoMap &map, } screenBounds_ = bb; - this->translate( -1 * sourceBounds_.topLeft() + QPointF(strokeWidth, strokeWidth)); + const QPointF strokeOffset = (adjustTranslation) ? QPointF(strokeWidth, strokeWidth) : QPointF(); + this->translate( -1 * sourceBounds_.topLeft() + strokeOffset); } void QGeoMapPolylineGeometry::clearSource() @@ -948,7 +950,7 @@ void QDeclarativePolylineMapItem::updatePolish() setWidth(geometry_.sourceBoundingBox().width() + 2 * line_.width()); setHeight(geometry_.sourceBoundingBox().height() + 2 * line_.width()); - setPositionOnMap(geometry_.origin(), -1 * geometry_.sourceBoundingBox().topLeft()); + setPositionOnMap(geometry_.origin(), -1 * geometry_.sourceBoundingBox().topLeft() + QPointF(line_.width(), line_.width())); } void QDeclarativePolylineMapItem::markSourceDirtyAndUpdate() |