summaryrefslogtreecommitdiffstats
path: root/src/imports/location/qdeclarativegeomapgesturearea.cpp
diff options
context:
space:
mode:
authorAnders Gunnarsson <anders.gunnarsson@appello.com>2013-11-19 16:36:04 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-21 12:00:51 +0100
commit80042e498bad0c13a8ee3326a0f1ab714ec3cd2c (patch)
tree5c3b29c901833cafa0a4bfdd72a6f8b163ac6907 /src/imports/location/qdeclarativegeomapgesturearea.cpp
parent469cbf8f601270ac0b030202ae303939ba4c63ff (diff)
Bugfix and improvement for start of panning
Fixed obvious mistake of subtracting touchCenterCoord_ from new start coordinate when starting a pan. This lead to a jump to a location close to 0,0 when touchCenterCoord_ was set. Since lastPos_ is also maintained as the center between two touch points, smooth start could also be done in that case. Change-Id: Icf8776aeb1ea3ae0cbadc74a28e2db22058f05d1 Reviewed-by: Fabian Bumberger <fbumberger@rim.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'src/imports/location/qdeclarativegeomapgesturearea.cpp')
-rw-r--r--src/imports/location/qdeclarativegeomapgesturearea.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/imports/location/qdeclarativegeomapgesturearea.cpp b/src/imports/location/qdeclarativegeomapgesturearea.cpp
index 99734dcb..970ec2eb 100644
--- a/src/imports/location/qdeclarativegeomapgesturearea.cpp
+++ b/src/imports/location/qdeclarativegeomapgesturearea.cpp
@@ -1055,14 +1055,10 @@ void QDeclarativeGeoMapGestureArea::panStateMachine()
switch (panState_) {
case panInactive:
if (canStartPan()) {
- if (touchPointState_ == touchPoints1) {
- // Update startCoord_ to ensure smooth start for panning when going over startDragDistance
- QGeoCoordinate newStartCoord = map_->screenPositionToCoordinate(QDoubleVector2D(lastPos_), false);
- startCoord_.setLongitude(newStartCoord.longitude() -
- touchCenterCoord_.longitude());
- startCoord_.setLatitude(newStartCoord.latitude() -
- touchCenterCoord_.latitude());
- }
+ // Update startCoord_ to ensure smooth start for panning when going over startDragDistance
+ QGeoCoordinate newStartCoord = map_->screenPositionToCoordinate(QDoubleVector2D(lastPos_), false);
+ startCoord_.setLongitude(newStartCoord.longitude());
+ startCoord_.setLatitude(newStartCoord.latitude());
panState_ = panActive;
}
break;