]> git.mxchange.org Git - flightgear.git/commitdiff
KLN89: Round properly when converting map points to pixel locations
authorDave Luff <daveluff@ntlworld.com>
Sun, 21 Nov 2010 20:46:14 +0000 (20:46 +0000)
committerDave Luff <daveluff@ntlworld.com>
Sun, 21 Nov 2010 20:46:14 +0000 (20:46 +0000)
src/Instrumentation/KLN89/kln89.cxx

index 807c911abca0b11145fc323e8fbdb89ae83f3ee5..48b69a0431caa558835c07ff5022587bcaddd5bb 100644 (file)
@@ -775,10 +775,10 @@ void KLN89::DrawMap(bool draw_avs) {
                        GPSWaypoint* wp1 = _activeFP->waypoints[i];
                        SGVec3d p0 = mapProj.ConvertToLocal(SGGeod::fromRad(wp0->lon, wp0->lat));
                        SGVec3d p1 = mapProj.ConvertToLocal(SGGeod::fromRad(wp1->lon, wp1->lat));
-                       int mx0 = int(p0.x() / meter_per_pix) + 56;
-                       int my0 = int(p0.y() / meter_per_pix) + (_mapOrientation == 0 ? 19 : 10);
-                       int mx1 = int(p1.x() / meter_per_pix) + 56;
-                       int my1 = int(p1.y() / meter_per_pix) + (_mapOrientation == 0 ? 19 : 10);
+                       int mx0 = int(p0.x() / meter_per_pix + 0.5) + 56;
+                       int my0 = int(p0.y() / meter_per_pix + 0.5) + (_mapOrientation == 0 ? 19 : 10);
+                       int mx1 = int(p1.x() / meter_per_pix + 0.5) + 56;
+                       int my1 = int(p1.y() / meter_per_pix + 0.5) + (_mapOrientation == 0 ? 19 : 10);
                        if(i == 1) {
                                xvec.push_back(mx0);
                                yvec.push_back(my0);