]> git.mxchange.org Git - flightgear.git/commitdiff
MapWidget: fix a crash on uninitialized.
authorjmt <jmt>
Wed, 21 Apr 2010 16:18:31 +0000 (16:18 +0000)
committerTim Moore <timoore33@gmail.com>
Sun, 25 Apr 2010 07:00:41 +0000 (09:00 +0200)
src/GUI/MapWidget.cxx

index 0e06b18b936907c33b4093f6701fc1d4ccd7861b..44b1f7601ad3729832db9aa20492be672bef6cec 100644 (file)
@@ -532,18 +532,18 @@ void MapWidget::draw(int dx, int dy)
   double julianDate = globals->get_time_params()->getJD();
   _magVar->update(_projectionCenter, julianDate);
 
-  SGGeod topLeft = unproject(SGVec2d(_width/2, _height/2));
-  // compute draw range, including a fudge factor for ILSs and other 'long'
-  // symbols
-  _drawRangeNm = SGGeodesy::distanceNm(_projectionCenter, topLeft) + 10.0;
-
   bool aircraftUp = _root->getBoolValue("aircraft-heading-up");
   if (aircraftUp) {
     _upHeading = fgGetDouble("/orientation/heading-deg");
   } else {
     _upHeading = 0.0;
   }
-    
+
+  SGGeod topLeft = unproject(SGVec2d(_width/2, _height/2));
+  // compute draw range, including a fudge factor for ILSs and other 'long'
+  // symbols
+  _drawRangeNm = SGGeodesy::distanceNm(_projectionCenter, topLeft) + 10.0;
+
 // drawing operations
   GLint sx = (int) abox.min[0],
     sy = (int) abox.min[1];