diff options
author | Alex Wilson <alex.wilson@nokia.com> | 2012-02-09 17:15:30 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-09 08:26:56 +0100 |
commit | 6bdb8bc0b844fb6a798efd8b551294652f956b89 (patch) | |
tree | 8256c2cebce02e68294a852d08b4f661dd65af3d /src/imports/location/qdeclarativerectanglemapitem.cpp | |
parent | d24206cf6d87966b32c8a1186c9fa682d66b8ee9 (diff) | |
download | qtlocation-6bdb8bc0b844fb6a798efd8b551294652f956b89.tar.gz |
Regenerate map object geometry on Map resize event
In some cases (eg static map objects in the Mapviewer example),
the resize event can race against the map setup routines and lose,
leading to lots of NaNs, invisible map objects or missing borders.
To remedy this as a temporary fix, we simply check for whether the
map size has changed in handleCameraDataChanged. This API probably
needs to be rethought in the near future.
Change-Id: I67a2132c756bb38bf1513fa1cf3efc3ccb5de0da
Reviewed-by: David Laing <david.laing@nokia.com>
Diffstat (limited to 'src/imports/location/qdeclarativerectanglemapitem.cpp')
-rw-r--r-- | src/imports/location/qdeclarativerectanglemapitem.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/imports/location/qdeclarativerectanglemapitem.cpp b/src/imports/location/qdeclarativerectanglemapitem.cpp index faf1ad94..2738a1df 100644 --- a/src/imports/location/qdeclarativerectanglemapitem.cpp +++ b/src/imports/location/qdeclarativerectanglemapitem.cpp @@ -336,6 +336,14 @@ void QDeclarativeRectangleMapItem::handleCameraDataChanged(const QGeoCameraData& geometry_.markSourceDirty(); borderGeometry_.markSourceDirty(); } + + QSizeF sz = QSizeF(quickMap()->width(), quickMap()->height()); + if (sz != mapSize_) { + mapSize_ = sz; + geometry_.markSourceDirty(); + borderGeometry_.markSourceDirty(); + } + geometry_.markScreenDirty(); borderGeometry_.markScreenDirty(); updateMapItem(); |