From 5ca3c11e60d4537994b8dc4168a16d1a4885af46 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 24 May 2013 16:06:51 -0700 Subject: [PATCH] Correct the code to enter dive locations The existing code converted the lat/lon to int before multiplying with 1,000,000 (in order to create udeg). Oops. Signed-off-by: Dirk Hohndel --- qt-ui/globe.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/qt-ui/globe.cpp b/qt-ui/globe.cpp index 95db19083..79d7cbee4 100644 --- a/qt-ui/globe.cpp +++ b/qt-ui/globe.cpp @@ -112,13 +112,12 @@ void GlobeGPS::changeDiveGeoPosition(qreal lon, qreal lat, GeoDataCoordinates::U lon = lon * 180 / M_PI; lat = lat * 180 / M_PI; } - if (!editingDiveCoords) { return; } - editingDiveCoords->latitude.udeg = (int) lat * 1000000.0; - editingDiveCoords->longitude.udeg = (int) lon * 1000000.0; + editingDiveCoords->latitude.udeg = lat * 1000000.0; + editingDiveCoords->longitude.udeg = lon * 1000000.0; centerOn(lon, lat, true); reload(); editingDiveCoords = 0; @@ -128,8 +127,8 @@ void GlobeGPS::changeDiveGeoPosition(qreal lon, qreal lat, GeoDataCoordinates::U void GlobeGPS::mousePressEvent(QMouseEvent* event) { qreal lat, lon; - if (editingDiveCoords && geoCoordinates(event->pos().x(), event->pos().y(), lon,lat, GeoDataCoordinates::Radian)) { - changeDiveGeoPosition(lon, lat, GeoDataCoordinates::Radian); + if (editingDiveCoords && geoCoordinates(event->pos().x(), event->pos().y(), lon, lat, GeoDataCoordinates::Degree)) { + changeDiveGeoPosition(lon, lat, GeoDataCoordinates::Degree); } }