diff options
author | Michal Klocek <michal.klocek@theqtcompany.com> | 2015-03-26 11:41:07 +0100 |
---|---|---|
committer | Michal Klocek <michal.klocek@theqtcompany.com> | 2015-05-22 22:00:42 +0000 |
commit | 929c9a46aaa75ec3c77a226eb9e8a2e956e4763c (patch) | |
tree | 455371eefe3ad535062a0685d216905fadceab00 /src | |
parent | fb983f85cf2636529dbaec4713bbf4e9b679d0ba (diff) | |
download | qtlocation-929c9a46aaa75ec3c77a226eb9e8a2e956e4763c.tar.gz |
Enable and update map flick and pinch autotest.
Make pan drag distance inclusive in
QDeclarativeGeoMapGestureArea which simplifies
unit testing on different platforms.
Use sceneCenter instead of lastPos for panning startup.
lastPos is used with velocity sampling which
makes it not reliable as a starting value.
Change-Id: If0d98e834a5e2d4264a51d70c2c39846cd2a677b
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/imports/location/qdeclarativegeomapgesturearea.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/imports/location/qdeclarativegeomapgesturearea.cpp b/src/imports/location/qdeclarativegeomapgesturearea.cpp index 05891626..b18864eb 100644 --- a/src/imports/location/qdeclarativegeomapgesturearea.cpp +++ b/src/imports/location/qdeclarativegeomapgesturearea.cpp @@ -994,7 +994,7 @@ void QDeclarativeGeoMapGestureArea::panStateMachine() case panInactive: if (canStartPan()) { // Update startCoord_ to ensure smooth start for panning when going over startDragDistance - QGeoCoordinate newStartCoord = map_->itemPositionToCoordinate(QDoubleVector2D(lastPos_), false); + QGeoCoordinate newStartCoord = map_->itemPositionToCoordinate(QDoubleVector2D(sceneCenter_), false); startCoord_.setLongitude(newStartCoord.longitude()); startCoord_.setLatitude(newStartCoord.latitude()); panState_ = panActive; @@ -1053,7 +1053,7 @@ bool QDeclarativeGeoMapGestureArea::canStartPan() QPointF p1 = declarativeMap_->mapFromScene(m_allPoints.at(0).scenePos()); int dyFromPress = int(p1.y() - sceneStartPoint1_.y()); int dxFromPress = int(p1.x() - sceneStartPoint1_.x()); - if ((qAbs(dyFromPress) > startDragDistance || qAbs(dxFromPress) > startDragDistance)) + if ((qAbs(dyFromPress) >= startDragDistance || qAbs(dxFromPress) >= startDragDistance)) return true; return false; } |