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>
This commit is contained in:
Dirk Hohndel 2013-05-24 16:06:51 -07:00
parent 5d05bb1207
commit 5ca3c11e60

View file

@ -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);
}
}