summaryrefslogtreecommitdiff
path: root/src/location
diff options
context:
space:
mode:
Diffstat (limited to 'src/location')
-rw-r--r--src/location/declarativemaps/qdeclarativepolygonmapitem.cpp13
-rw-r--r--src/location/declarativemaps/qdeclarativepolygonmapitem_p.h2
2 files changed, 9 insertions, 6 deletions
diff --git a/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp b/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp
index b019a073..9e96f3c6 100644
--- a/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp
+++ b/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp
@@ -246,7 +246,7 @@ void QGeoMapPolygonGeometry::updateSourcePoints(const QGeoMap &map,
/*!
\internal
*/
-void QGeoMapPolygonGeometry::updateScreenPoints(const QGeoMap &map)
+void QGeoMapPolygonGeometry::updateScreenPoints(const QGeoMap &map, qreal strokeWidth)
{
if (!screenDirty_)
return;
@@ -310,6 +310,8 @@ void QGeoMapPolygonGeometry::updateScreenPoints(const QGeoMap &map)
}
screenBounds_ = ppi.boundingRect();
+ if (strokeWidth != 0.0)
+ this->translate(QPointF(strokeWidth, strokeWidth));
}
QDeclarativePolygonMapItem::QDeclarativePolygonMapItem(QQuickItem *parent)
@@ -515,7 +517,7 @@ void QDeclarativePolygonMapItem::updatePolish()
updatingGeometry_ = true;
geometry_.updateSourcePoints(*map(), geopathProjected_);
- geometry_.updateScreenPoints(*map());
+ geometry_.updateScreenPoints(*map(), border_.width());
QList<QGeoMapItemGeometry *> geoms;
geoms << &geometry_;
@@ -546,10 +548,11 @@ void QDeclarativePolygonMapItem::updatePolish()
}
QRectF combined = QGeoMapItemGeometry::translateToCommonOrigin(geoms);
- setWidth(combined.width());
- setHeight(combined.height());
+ setWidth(combined.width() + 2 * border_.width());
+ setHeight(combined.height() + 2 * border_.width());
- setPositionOnMap(geometry_.origin(), -1 * geometry_.sourceBoundingBox().topLeft());
+ setPositionOnMap(geometry_.origin(), -1 * geometry_.sourceBoundingBox().topLeft()
+ + QPointF(border_.width(), border_.width()));
}
void QDeclarativePolygonMapItem::markSourceDirtyAndUpdate()
diff --git a/src/location/declarativemaps/qdeclarativepolygonmapitem_p.h b/src/location/declarativemaps/qdeclarativepolygonmapitem_p.h
index 1e2a91c9..febeb751 100644
--- a/src/location/declarativemaps/qdeclarativepolygonmapitem_p.h
+++ b/src/location/declarativemaps/qdeclarativepolygonmapitem_p.h
@@ -70,7 +70,7 @@ public:
void updateSourcePoints(const QGeoMap &map,
const QList<QDoubleVector2D> &path);
- void updateScreenPoints(const QGeoMap &map);
+ void updateScreenPoints(const QGeoMap &map, qreal strokeWidth = 0.0);
protected:
QPainterPath srcPath_;