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

Bastian Holst bastianholst at gmx.de
Sun Aug 9 18:04:41 CEST 2009


SVN commit 1009288 by bholst:

Use GeoDataCoordinates::normalizeLon/Lat in GeoPainter


 M  +4 -14     GeoPainter.cpp  


--- trunk/KDE/kdeedu/marble/src/lib/GeoPainter.cpp #1009287:1009288
@@ -153,22 +153,12 @@
         qreal altitude = centerCoordinates.altitude();
         centerCoordinates.geoCoordinates( lon, lat, GeoDataCoordinates::Degree );
 
-        qreal west = lon - width * 0.5;
-        if ( west < -180 ) west = west + 360;
-        if ( west > 180 ) west = west - 360;
+        qreal west = GeoDataCoordinates::normalizeLon( lon - width * 0.5 );
+        qreal east =  GeoDataCoordinates::normalizeLon( lon + width * 0.5 );
 
-        qreal east =  lon + width * 0.5;
-        if ( east < -180 ) east = east + 360;
-        if ( east > 180 ) east = east - 360;
+        qreal north = GeoDataCoordinates::normalizeLat( lat + height * 0.5 );
+        qreal south = GeoDataCoordinates::normalizeLat( lat - height * 0.5 );
 
-        qreal north = lat + height * 0.5;
-        if ( north > +90.0 ) north = 90.0;
-        if ( north < -90.0 ) north = -90.0;
-
-        qreal south = lat - height * 0.5;
-        if ( south > +90.0 ) south = 90.0;
-        if ( south < -90.0 ) south = -90.0;
-
         GeoDataCoordinates southWest( west, south,
                                       altitude, GeoDataCoordinates::Degree );
         GeoDataCoordinates southEast( east, south,


More information about the Marble-commits mailing list