[Marble-commits] branches/KDE/4.3/kdeedu/marble/src/lib

Torsten Rahn tackat at kde.org
Fri Jul 17 04:31:36 CEST 2009


SVN commit 998157 by rahn:

BUG: 200500

Backport



 M  +5 -8      Projections/SphericalProjection.cpp  
 M  +1 -1      geodata/data/GeoDataLatLonBox.cpp  


--- branches/KDE/4.3/kdeedu/marble/src/lib/Projections/SphericalProjection.cpp #998156:998157
@@ -227,8 +227,8 @@
     // analytically the lon-/lat- range.
     qreal pitch = GeoDataPoint::normalizeLat( viewport->planetAxis().pitch() );
 
-    if ( 2 * viewport->radius() + 1 <= viewport->height()
-         &&  2 * viewport->radius() + 1 <= viewport->width() )
+    if ( 2.0 * viewport->radius() <= viewport->height()
+         &&  2.0 * viewport->radius() <= viewport->width() )
     { 
         // Unless the planetaxis is in the screen plane the allowed longitude range
         // covers full -180 deg to +180 deg:
@@ -239,7 +239,7 @@
             latLonAltBox.setNorth( +fabs( M_PI / 2.0 - fabs( pitch ) ) );
             latLonAltBox.setSouth( -M_PI / 2.0 );
         }
-        if ( pitch < +0.0 || pitch < -M_PI ) {
+        if ( pitch < 0.0 && pitch > -M_PI ) {
             latLonAltBox.setWest(  -M_PI );
             latLonAltBox.setEast(  +M_PI );
             latLonAltBox.setNorth( +M_PI / 2.0 );
@@ -268,14 +268,11 @@
     qreal dummyX, dummyY; // not needed
     bool dummyVal;
 
-    if ( screenCoordinates( maxLatPoint, viewport, dummyX, dummyY, dummyVal ) ) {
+    if ( screenCoordinates( maxLatPoint, viewport, dummyX, dummyY, dummyVal ) ||
+         screenCoordinates( minLatPoint, viewport, dummyX, dummyY, dummyVal ) ) {
         latLonAltBox.setWest( -M_PI );
         latLonAltBox.setEast( +M_PI );
     }
-    if ( screenCoordinates( minLatPoint, viewport, dummyX, dummyY, dummyVal ) ) {
-        latLonAltBox.setWest( -M_PI );
-        latLonAltBox.setEast( +M_PI );
-    }
 
 //    qDebug() << latLonAltBox.text( GeoDataCoordinates::Degree );
 
--- branches/KDE/4.3/kdeedu/marble/src/lib/geodata/data/GeoDataLatLonBox.cpp #998156:998157
@@ -294,7 +294,7 @@
     // We need to take care of the normal case ...
     if ( ( ( lon < d->m_west || lon > d->m_east ) && ( d->m_west < d->m_east ) ) ||
     // ... and the case where the bounding box crosses the date line:
-         ( ( lon > d->m_west || lon < d->m_east ) && ( d->m_west > d->m_east ) ) )
+         ( ( lon < d->m_west && lon > d->m_east ) && ( d->m_west > d->m_east ) ) )
         return false;
     
     if ( lat < d->m_south || lat > d->m_north )


More information about the Marble-commits mailing list