From b33d8c905e5b89a391d465d4bb1210401b3d336b Mon Sep 17 00:00:00 2001 From: Paolo Angelelli Date: Tue, 13 Sep 2016 16:14:38 +0200 Subject: Fix for polylines and polygon rendering wrong at the edge of the map This patch fixes a bug in rendering (re)created polylines/polygons right at the edge of a map, due to not setting preserve geometry to true on geometry modifying methods (addCoordinate/setPath/etc) Task-number: QTBUG-55964 Change-Id: I94bc86e8c908bc0ab4a949d96094988ed7ea26a7 Reviewed-by: Michal Klocek --- src/imports/location/qdeclarativepolygonmapitem.cpp | 6 ++++++ src/imports/location/qdeclarativepolylinemapitem.cpp | 5 +++++ 2 files changed, 11 insertions(+) (limited to 'src/imports') diff --git a/src/imports/location/qdeclarativepolygonmapitem.cpp b/src/imports/location/qdeclarativepolygonmapitem.cpp index 361c554d..3d981406 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 d10d00a5..e349b287 100644 --- a/src/imports/location/qdeclarativepolylinemapitem.cpp +++ b/src/imports/location/qdeclarativepolylinemapitem.cpp @@ -556,6 +556,7 @@ void QDeclarativePolylineMapItem::setPathFromGeoList(const QList 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(); -- cgit v1.2.1 From 42372ce4c4114f7e38fc5ac681e9199869b4619f Mon Sep 17 00:00:00 2001 From: Paolo Angelelli Date: Thu, 25 Aug 2016 15:29:16 +0200 Subject: Fix for Map polygon not working on zoom This patch fixes a bug in the calculation of the geoleftbound of map polylines/polygons Task-number: QTBUG-55535 Change-Id: I11c2d2cecfdb183944d2f2766180938efa3deef6 Reviewed-by: Alex Blasche Reviewed-by: Michal Klocek --- src/imports/location/qdeclarativepolylinemapitem.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/imports') diff --git a/src/imports/location/qdeclarativepolylinemapitem.cpp b/src/imports/location/qdeclarativepolylinemapitem.cpp index e349b287..3c29ad2b 100644 --- a/src/imports/location/qdeclarativepolylinemapitem.cpp +++ b/src/imports/location/qdeclarativepolylinemapitem.cpp @@ -767,15 +767,15 @@ QGeoCoordinate QDeclarativePolylineMapItem::updateLeftBound(const QList Date: Thu, 13 Oct 2016 11:14:38 +0200 Subject: Fix compilation 6df6c10e1af827d06a387e7422176dd310cf83be in qtdeclarative changed enum values. Change-Id: I55ffa6a2e55a63aec455db533e9d7b08a44978bb Reviewed-by: Michal Klocek Reviewed-by: Laszlo Agocs --- src/imports/location/qgeomapitemgeometry.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/imports') diff --git a/src/imports/location/qgeomapitemgeometry.cpp b/src/imports/location/qgeomapitemgeometry.cpp index 513feb2a..c8168f67 100644 --- a/src/imports/location/qgeomapitemgeometry.cpp +++ b/src/imports/location/qgeomapitemgeometry.cpp @@ -70,11 +70,11 @@ void QGeoMapItemGeometry::allocateAndFill(QSGGeometry *geom) const if (isIndexed()) { geom->allocate(vx.size(), ix.size()); - if (geom->indexType() == QSGGeometry::TypeUnsignedShort) { + if (geom->indexType() == QSGGeometry::UnsignedShortType) { quint16 *its = geom->indexDataAsUShort(); for (int i = 0; i < ix.size(); ++i) its[i] = ix[i]; - } else if (geom->indexType() == QSGGeometry::TypeUnsignedInt) { + } else if (geom->indexType() == QSGGeometry::UnsignedIntType) { quint32 *its = geom->indexDataAsUInt(); for (int i = 0; i < ix.size(); ++i) its[i] = ix[i]; -- cgit v1.2.1 From 3db74efd86aa0d724ca94bab5168aa9f92d3c18d Mon Sep 17 00:00:00 2001 From: Vyacheslav Koscheev Date: Thu, 27 Oct 2016 11:34:24 +0700 Subject: Compilation fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit minimumZoomLevel() returns qreal, qreal can be float Task-number: QTBUG-56715 Change-Id: I7a5b5667b1c50518a216c401d97104b1909632df Reviewed-by: Michal Klocek Reviewed-by: Ola Røer Thorsen --- src/imports/location/qdeclarativegeomap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/imports') diff --git a/src/imports/location/qdeclarativegeomap.cpp b/src/imports/location/qdeclarativegeomap.cpp index ad2b78da..7e8e1728 100644 --- a/src/imports/location/qdeclarativegeomap.cpp +++ b/src/imports/location/qdeclarativegeomap.cpp @@ -889,7 +889,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(), m_map->mapController()->zoom() + double newZoom = qMax(minimumZoomLevel(), m_map->mapController()->zoom() - zoomRatio); setZoomLevel(newZoom); m_validRegion = true; -- cgit v1.2.1