[Marble-commits] KDE/kdeedu/marble/src/lib
Torsten Rahn
tackat at kde.org
Tue Jul 28 15:15:52 CEST 2009
SVN commit 1003611 by rahn:
- Prevent the case where the distance is 0.
M +9 -1 MarbleMap.cpp
--- trunk/KDE/kdeedu/marble/src/lib/MarbleMap.cpp #1003610:1003611
@@ -497,7 +497,7 @@
// (about 800 pixels) equals the viewing angle of a human being.
const qreal VIEW_ANGLE = 110.0;
-
+
return ( model()->planet()->radius() * 0.4
/ (qreal)( radius() )
/ tan( 0.5 * VIEW_ANGLE * DEG2RAD ) );
@@ -505,6 +505,13 @@
void MarbleMap::setDistance( qreal distance )
{
+ qreal minDistance = 0.0001;
+
+ if ( distance <= minDistance ) {
+ qDebug() << "Invalid distance: 0 m";
+ distance = minDistance;
+ }
+
const qreal VIEW_ANGLE = 110.0;
setRadius( (int)( model()->planet()->radius() * 0.4
@@ -1203,6 +1210,7 @@
// reality. Therefore we assume that the average window width
// (about 800 pixels) equals the viewing angle of a human being.
//
+
qreal distance = ( model()->planet()->radius() * 0.4
/ (qreal)( radius() )
/ tan( 0.5 * VIEW_ANGLE * DEG2RAD ) );
More information about the Marble-commits
mailing list