]> git.mxchange.org Git - flightgear.git/blobdiff - src/GUI/WaypointList.cxx
toggle fullscreen: also adapt GUI plane when resizing
[flightgear.git] / src / GUI / WaypointList.cxx
index e8e5b36dcb40e2625d1225095519182884e225f1..20183d44ea314894ef63520ccb2ed7317d094734 100644 (file)
@@ -90,14 +90,13 @@ public:
       --destIndex;
     }
     
-    unsigned int currentWpIndex = currentWaypoint();
-    WayptRef w(waypointAt(currentWpIndex));
-    _fp->deleteIndex(currentWpIndex);
+     int currentWpIndex = currentWaypoint();
     
-    SG_LOG(SG_GENERAL, SG_INFO, "wpt:" << w->ident());
+    WayptRef w = _fp->legAtIndex(srcIndex)->waypoint();
+    _fp->deleteIndex(srcIndex);
     _fp->insertWayptAtIndex(w, destIndex);
 
-    if (srcIndex == currentWpIndex) {
+    if ((signed int) srcIndex == currentWpIndex) {
         // current waypoint was moved
         _fp->setCurrentIndex(destIndex);
     }