diff options
author | Alex Blasche <alexander.blasche@qt.io> | 2016-11-02 13:14:00 +0100 |
---|---|---|
committer | Alex Blasche <alexander.blasche@qt.io> | 2016-11-02 13:14:06 +0100 |
commit | 1c0b494ae0d780230e2ed410ef74353dc1a2ea77 (patch) | |
tree | dedac7c676ebd9dafdfc2879e5a330e4f69ba367 /src/imports | |
parent | 315b4325d0b55d1104d1615fa6f7ecc12465f8f2 (diff) | |
parent | 16423f84f970d7dac644a4b041e3ebe2ac0f6e22 (diff) | |
download | qtlocation-1c0b494ae0d780230e2ed410ef74353dc1a2ea77.tar.gz |
Merge remote-tracking branch 'gerrit/5.7' into 5.8
Conflicts:
tests/auto/declarative_ui/BLACKLIST
Change-Id: I0f6c9228c899c4d1d55fffc596c661ee0f6c2b66
Diffstat (limited to 'src/imports')
-rw-r--r-- | src/imports/location/qdeclarativegeomap.cpp | 3 | ||||
-rw-r--r-- | src/imports/location/qdeclarativepolygonmapitem.cpp | 6 | ||||
-rw-r--r-- | src/imports/location/qdeclarativepolylinemapitem.cpp | 17 |
3 files changed, 18 insertions, 8 deletions
diff --git a/src/imports/location/qdeclarativegeomap.cpp b/src/imports/location/qdeclarativegeomap.cpp index e311d77f..0f54929b 100644 --- a/src/imports/location/qdeclarativegeomap.cpp +++ b/src/imports/location/qdeclarativegeomap.cpp @@ -967,8 +967,7 @@ void QDeclarativeGeoMap::fitViewportToGeoShape() bboxHeight / (height() - margins)); // fixme: use log2 with c++11 zoomRatio = std::log(zoomRatio) / std::log(2.0); - double newZoom = qMax(minimumZoomLevel(), zoomLevel() - - zoomRatio); + double newZoom = qMax<double>(minimumZoomLevel(), zoomLevel() - zoomRatio); setZoomLevel(newZoom); m_validRegion = true; } diff --git a/src/imports/location/qdeclarativepolygonmapitem.cpp b/src/imports/location/qdeclarativepolygonmapitem.cpp index d997f590..a42892b7 100644 --- a/src/imports/location/qdeclarativepolygonmapitem.cpp +++ b/src/imports/location/qdeclarativepolygonmapitem.cpp @@ -431,6 +431,8 @@ void QDeclarativePolygonMapItem::setPath(const QJSValue &value) path_ = pathList; geoLeftBound_ = QDeclarativePolylineMapItem::getLeftBound(path_, deltaXs_, minX_); + geometry_.setPreserveGeometry(true, geoLeftBound_); + borderGeometry_.setPreserveGeometry(true, geoLeftBound_); geometry_.markSourceDirty(); borderGeometry_.markSourceDirty(); polishAndUpdate(); @@ -449,6 +451,8 @@ void QDeclarativePolygonMapItem::addCoordinate(const QGeoCoordinate &coordinate) { path_.append(coordinate); geoLeftBound_ = QDeclarativePolylineMapItem::getLeftBound(path_, deltaXs_, minX_, geoLeftBound_); + geometry_.setPreserveGeometry(true, geoLeftBound_); + borderGeometry_.setPreserveGeometry(true, geoLeftBound_); geometry_.markSourceDirty(); borderGeometry_.markSourceDirty(); polishAndUpdate(); @@ -473,6 +477,8 @@ void QDeclarativePolygonMapItem::removeCoordinate(const QGeoCoordinate &coordina path_.removeAt(index); geoLeftBound_ = QDeclarativePolylineMapItem::getLeftBound(path_, deltaXs_, minX_); + geometry_.setPreserveGeometry(true, geoLeftBound_); + borderGeometry_.setPreserveGeometry(true, geoLeftBound_); geometry_.markSourceDirty(); borderGeometry_.markSourceDirty(); polishAndUpdate(); diff --git a/src/imports/location/qdeclarativepolylinemapitem.cpp b/src/imports/location/qdeclarativepolylinemapitem.cpp index 32791b29..c4150d2a 100644 --- a/src/imports/location/qdeclarativepolylinemapitem.cpp +++ b/src/imports/location/qdeclarativepolylinemapitem.cpp @@ -556,6 +556,7 @@ void QDeclarativePolylineMapItem::setPathFromGeoList(const QList<QGeoCoordinate> path_ = path; geoLeftBound_ = getLeftBound(path_, deltaXs_, minX_); + geometry_.setPreserveGeometry(true, geoLeftBound_); geometry_.markSourceDirty(); polishAndUpdate(); emit pathChanged(); @@ -586,6 +587,7 @@ void QDeclarativePolylineMapItem::addCoordinate(const QGeoCoordinate &coordinate { path_.append(coordinate); geoLeftBound_ = getLeftBound(path_, deltaXs_, minX_, geoLeftBound_); + geometry_.setPreserveGeometry(true, geoLeftBound_); geometry_.markSourceDirty(); polishAndUpdate(); emit pathChanged(); @@ -607,6 +609,7 @@ void QDeclarativePolylineMapItem::insertCoordinate(int index, const QGeoCoordina path_.insert(index, coordinate); geoLeftBound_ = getLeftBound(path_, deltaXs_, minX_); + geometry_.setPreserveGeometry(true, geoLeftBound_); geometry_.markSourceDirty(); polishAndUpdate(); emit pathChanged(); @@ -629,6 +632,7 @@ void QDeclarativePolylineMapItem::replaceCoordinate(int index, const QGeoCoordin path_[index] = coordinate; geoLeftBound_ = getLeftBound(path_, deltaXs_, minX_); + geometry_.setPreserveGeometry(true, geoLeftBound_); geometry_.markSourceDirty(); polishAndUpdate(); emit pathChanged(); @@ -697,6 +701,7 @@ void QDeclarativePolylineMapItem::removeCoordinate(int index) path_.removeAt(index); geoLeftBound_ = getLeftBound(path_, deltaXs_, minX_); + geometry_.setPreserveGeometry(true, geoLeftBound_); geometry_.markSourceDirty(); polishAndUpdate(); emit pathChanged(); @@ -762,15 +767,15 @@ QGeoCoordinate QDeclarativePolylineMapItem::updateLeftBound(const QList<QGeoCoor QGeoCoordinate currentLeftBound) { if (path.isEmpty()) { + deltaXs.clear(); minX = qInf(); return QGeoCoordinate(); } else if (path.size() == 1) { - deltaXs.clear(); - minX = 0.0; + deltaXs.resize(1); + deltaXs[0] = minX = 0.0; return path.last(); - } else if ( path.size() != deltaXs.size() + 2 ) { // this case should not happen - minX = qInf(); - return QGeoCoordinate(); + } else if ( path.size() != deltaXs.size() + 1 ) { // something went wrong. This case should not happen + return computeLeftBound(path, deltaXs, minX); } const QGeoCoordinate &geoFrom = path.at(path.size()-2); @@ -786,7 +791,7 @@ QGeoCoordinate QDeclarativePolylineMapItem::updateLeftBound(const QList<QGeoCoor deltaLongi = longiTo - longiFrom; } - deltaXs.push_back((deltaXs.isEmpty()) ? 0.0 : deltaXs.last() + deltaLongi); + deltaXs.push_back(deltaXs.last() + deltaLongi); if (deltaXs.last() < minX) { minX = deltaXs.last(); return path.last(); |