mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
5d05bb1207
commit
5ca3c11e60
1 changed files with 4 additions and 5 deletions
|
@ -112,13 +112,12 @@ void GlobeGPS::changeDiveGeoPosition(qreal lon, qreal lat, GeoDataCoordinates::U
|
||||||
lon = lon * 180 / M_PI;
|
lon = lon * 180 / M_PI;
|
||||||
lat = lat * 180 / M_PI;
|
lat = lat * 180 / M_PI;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!editingDiveCoords) {
|
if (!editingDiveCoords) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
editingDiveCoords->latitude.udeg = (int) lat * 1000000.0;
|
editingDiveCoords->latitude.udeg = lat * 1000000.0;
|
||||||
editingDiveCoords->longitude.udeg = (int) lon * 1000000.0;
|
editingDiveCoords->longitude.udeg = lon * 1000000.0;
|
||||||
centerOn(lon, lat, true);
|
centerOn(lon, lat, true);
|
||||||
reload();
|
reload();
|
||||||
editingDiveCoords = 0;
|
editingDiveCoords = 0;
|
||||||
|
@ -128,8 +127,8 @@ void GlobeGPS::changeDiveGeoPosition(qreal lon, qreal lat, GeoDataCoordinates::U
|
||||||
void GlobeGPS::mousePressEvent(QMouseEvent* event)
|
void GlobeGPS::mousePressEvent(QMouseEvent* event)
|
||||||
{
|
{
|
||||||
qreal lat, lon;
|
qreal lat, lon;
|
||||||
if (editingDiveCoords && geoCoordinates(event->pos().x(), event->pos().y(), lon,lat, GeoDataCoordinates::Radian)) {
|
if (editingDiveCoords && geoCoordinates(event->pos().x(), event->pos().y(), lon, lat, GeoDataCoordinates::Degree)) {
|
||||||
changeDiveGeoPosition(lon, lat, GeoDataCoordinates::Radian);
|
changeDiveGeoPosition(lon, lat, GeoDataCoordinates::Degree);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue