diff options
author | Paolo Angelelli <paolo.angelelli@qt.io> | 2018-04-17 13:38:37 +0200 |
---|---|---|
committer | Paolo Angelelli <paolo.angelelli@qt.io> | 2018-04-20 07:22:39 +0000 |
commit | e2fb666418f023ad99bede7adffd670eb749b707 (patch) | |
tree | 59a1e013c27eebe2000a748119743d5da063986e /src/location | |
parent | 40b9692ba98b93da50e7a3d35c178c41853c3d0a (diff) | |
download | qtlocation-e2fb666418f023ad99bede7adffd670eb749b707.tar.gz |
Fix MapCircle QQuickItem geometry to allow enabling layers
This patch does not include a fix for the degenerated cases:
- circle including one pole
- circle including both poles
Change-Id: I78d9a29bf1071ab3b3405179f34f42a71c0a79a5
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/location')
-rw-r--r-- | src/location/declarativemaps/qdeclarativecirclemapitem.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/location/declarativemaps/qdeclarativecirclemapitem.cpp b/src/location/declarativemaps/qdeclarativecirclemapitem.cpp index a30b7b30..608260cd 100644 --- a/src/location/declarativemaps/qdeclarativecirclemapitem.cpp +++ b/src/location/declarativemaps/qdeclarativecirclemapitem.cpp @@ -513,7 +513,7 @@ void QDeclarativeCircleMapItem::updatePolish() invertedCircle = true; } else { geometry_.updateSourcePoints(*map(), circlePath); - geometry_.updateScreenPoints(*map()); + geometry_.updateScreenPoints(*map(), border_.width()); } borderGeometry_.clear(); @@ -552,9 +552,17 @@ void QDeclarativeCircleMapItem::updatePolish() } QRectF combined = QGeoMapItemGeometry::translateToCommonOrigin(geoms); - setWidth(combined.width()); - setHeight(combined.height()); + if (invertedCircle || !preserve) { + setWidth(combined.width()); + setHeight(combined.height()); + setPositionOnMap(geometry_.origin(), geometry_.firstPointOffset()); + } else { + setWidth(combined.width() + 2 * border_.width()); + setHeight(combined.height() + 2 * border_.width()); + } + + // No offsetting here, even in normal case, because first point offset is already translated setPositionOnMap(geometry_.origin(), geometry_.firstPointOffset()); } |