diff --git a/src/GUI/MapWidget.cxx b/src/GUI/MapWidget.cxx index cd648fefb..e3cc5de77 100644 --- a/src/GUI/MapWidget.cxx +++ b/src/GUI/MapWidget.cxx @@ -386,6 +386,7 @@ MapWidget::MapWidget(int x, int y, int maxX, int maxY) : _zoom = 6; _width = maxX - x; _height = maxY - y; + _hasPanned = false; MapData::setFont(legendFont); MapData::setPalette(colour); @@ -496,6 +497,7 @@ int MapWidget::checkKey (int key, int updown ) void MapWidget::pan(const SGVec2d& delta) { + _hasPanned = true; _projectionCenter = unproject(-delta); } @@ -525,6 +527,12 @@ void MapWidget::draw(int dx, int dy) fgGetDouble("/position/latitude-deg")); _magneticHeadings = _root->getBoolValue("magnetic-headings"); + if (_hasPanned) + { + _root->setBoolValue("centre-on-aircraft", false); + _hasPanned = false; + } + else if (_root->getBoolValue("centre-on-aircraft")) { _projectionCenter = _aircraft; } diff --git a/src/GUI/MapWidget.hxx b/src/GUI/MapWidget.hxx index f2722e327..ce9333e32 100644 --- a/src/GUI/MapWidget.hxx +++ b/src/GUI/MapWidget.hxx @@ -85,6 +85,7 @@ private: double _drawRangeNm; double _upHeading; // true heading corresponding to +ve y-axis bool _magneticHeadings; + bool _hasPanned; SGGeod _projectionCenter; SGGeod _aircraft;