From 3419b28919e9e537cc6a59fabba342353a1cd261 Mon Sep 17 00:00:00 2001 From: jmt <jmt> Date: Wed, 21 Apr 2010 16:18:31 +0000 Subject: [PATCH] MapWidget: fix a crash on uninitialized. --- src/GUI/MapWidget.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/GUI/MapWidget.cxx b/src/GUI/MapWidget.cxx index 0e06b18b9..44b1f7601 100644 --- a/src/GUI/MapWidget.cxx +++ b/src/GUI/MapWidget.cxx @@ -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];