]> git.mxchange.org Git - flightgear.git/blobdiff - src/GUI/WaypointList.cxx
Continuous replay: use correct replay duration
[flightgear.git] / src / GUI / WaypointList.cxx
index 1c1014e0393ae7f0df5a594fe07bf1bc4c9d4d80..4f9d68b13af2cecd50797d313752d6b4d1147f90 100644 (file)
@@ -83,9 +83,15 @@ public:
       --destIndex;
     }
     
+    unsigned int currentWpIndex = currentWaypoint();
     WayptRef w(_rm->removeWayptAtIndex(srcIndex));
     SG_LOG(SG_GENERAL, SG_INFO, "wpt:" << w->ident());
     _rm->insertWayptAtIndex(w, destIndex);
+
+    if (srcIndex == currentWpIndex) {
+        // current waypoint was moved
+        _rm->jumpToIndex(destIndex);
+    }
   }
   
   virtual void setUpdateCallback(SGCallback* cb)
@@ -467,7 +473,10 @@ void WaypointList::drawRow(int dx, int dy, int rowIndex, int y)
   } // of valid wp altitude
   x += 60 + PUSTR_LGAP;
   
-  if (wp->speedRestriction() != RESTRICT_NONE) {
+  if (wp->speedRestriction() == SPEED_RESTRICT_MACH) {
+    count = ::snprintf(buffer, 126, "%03.2fM", wp->speedMach());
+    f->drawString(buffer, x, yy);
+  } else if (wp->speedRestriction() != RESTRICT_NONE) {
     count = ::snprintf(buffer, 126, "%dKts", (int) wp->speedKts());
     f->drawString(buffer, x, yy);
   }
@@ -818,6 +827,7 @@ void ScrolledWaypointList::setScrollPercent(float v)
 void ScrolledWaypointList::setSize(int w, int h)
 {
   updateWantsScroll(w, h);
+  puGroup::setSize(w, h);
 }
 
 void ScrolledWaypointList::updateWantsScroll(int w, int h)