diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2013-05-24 16:06:51 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-05-25 08:17:56 -0700 |
commit | 5ca3c11e60d4537994b8dc4168a16d1a4885af46 (patch) | |
tree | 9e72d88f32a542b1bab217bf288abc22d1e74f03 | |
parent | 5d05bb120716707ae0438f5a0395759bbf740fe1 (diff) | |
download | subsurface-5ca3c11e60d4537994b8dc4168a16d1a4885af46.tar.gz |
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 <dirk@hohndel.org>
-rw-r--r-- | qt-ui/globe.cpp | 9 |
1 files 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); } } |