aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2015-09-25 13:29:05 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-09-27 06:43:18 -0400
commit94d05d1cb6c5a63540a82e32056b89456e494fcb (patch)
tree0d5c3da7716a98a8d62daa435b139ad7fc4a74d3 /qt-ui
parent1239056fb6186279f915c8b3a8af733e74cb6523 (diff)
downloadsubsurface-94d05d1cb6c5a63540a82e32056b89456e494fcb.tar.gz
Do not try to center if already on center
This makes the globe smoother while moving around same gps dive sites. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/globe.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/qt-ui/globe.cpp b/qt-ui/globe.cpp
index aceeed9ab..a0866e475 100644
--- a/qt-ui/globe.cpp
+++ b/qt-ui/globe.cpp
@@ -257,6 +257,10 @@ void GlobeGPS::centerOnDiveSite(struct dive_site *ds)
qreal longitude = ds->longitude.udeg / 1000000.0;
qreal latitude = ds->latitude.udeg / 1000000.0;
+ if(IS_FP_SAME(longitude, centerLongitude()) && IS_FP_SAME(latitude,centerLatitude())) {
+ return;
+ }
+
// if no zoom is set up, set the zoom as seen from 3km above
// if we come back from a dive without GPS data, reset to the last zoom value
// otherwise check to make sure we aren't still running an animation and then remember