From 94d05d1cb6c5a63540a82e32056b89456e494fcb Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Fri, 25 Sep 2015 13:29:05 -0300 Subject: 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 Signed-off-by: Dirk Hohndel --- qt-ui/globe.cpp | 4 ++++ 1 file changed, 4 insertions(+) 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 -- cgit v1.2.3-70-g09d2