]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATC/ATCdisplay.cxx
Fix the nmea and garmin output to a) fake a GSA sentence, b) fix a y2k bug
[flightgear.git] / src / ATC / ATCdisplay.cxx
index 85bb9245efed9f77ba3221497941c97f7451d54a..6d0fda8bedb8d0e66004c21849b0bec09865136a 100644 (file)
@@ -22,7 +22,7 @@
 #  include <config.h>
 #endif
 
-#include <simgear/misc/props.hxx>
+#include <simgear/props/props.hxx>
 
 #include <Include/general.hxx>
 #include <Main/fg_props.hxx>
@@ -168,10 +168,10 @@ void FGATCDisplay::update(double dt) {
                                                //cout << "Stopping single message\n";
                                                msgList_itr = msgList.erase(msgList_itr);
                                        } else if(m.counter > m.start_count) {
-                                               guiFnt.drawString( m.msg.c_str(),
-                                               (iwidth - (m.msg.size() * 8))/2,
-                                               //iwidth/2,
-                                               (iheight - 40) );       // TODO - relate the distance in that the string is rendered to the string length.
+                                               int pin = (((int)m.msg.size() * 8) >= iwidth ? 5 : (iwidth - (m.msg.size() * 8))/2);
+                                               //cout << m.msg << '\n';
+                                               //cout << "pin = " << pin << ", iwidth = " << iwidth << ", msg.size = " << m.msg.size() << '\n';
+                                               guiFnt.drawString( m.msg.c_str(), pin, (iheight - 40) );
                                                m.counter += dt;
                                                msgList[i] = m;
                                                ++msgList_itr;