[Marble-commits] KDE/kdeedu/marble/src/lib/Projections
Bernhard Beschow
bbeschow at cs.tu-berlin.de
Sun Sep 19 00:50:42 CEST 2010
SVN commit 1176860 by beschow:
eliminate MercatorProjection:::geoCoordinates()::noerr
M +5 -6 MercatorProjection.cpp
--- trunk/KDE/kdeedu/marble/src/lib/Projections/MercatorProjection.cpp #1176859:1176860
@@ -252,7 +252,6 @@
int radius = viewport->radius();
int halfImageWidth = viewport->width() / 2;
int halfImageHeight = viewport->height() / 2;
- bool noerr = false;
// Calculate translation of center point
qreal centerLon;
@@ -266,7 +265,10 @@
int yTop = halfImageHeight - 2 * radius + yCenterOffset;
int yBottom = yTop + 4 * radius;
- if ( y >= yTop && y < yBottom ) {
+ if ( y < yTop || yBottom <= y ) {
+ return false;
+ }
+
int const xPixels = x - halfImageWidth;
qreal const pixel2Rad = M_PI / (2 * radius);
@@ -277,15 +279,12 @@
while ( lon > M_PI ) lon -= 2*M_PI;
while ( lon < -M_PI ) lon += 2*M_PI;
- noerr = true;
- }
-
if ( unit == GeoDataCoordinates::Degree ) {
lon *= RAD2DEG;
lat *= RAD2DEG;
}
- return noerr;
+ return true;
}
More information about the Marble-commits
mailing list