From: Dave Luff Date: Sun, 21 Nov 2010 20:46:14 +0000 (+0000) Subject: KLN89: Round properly when converting map points to pixel locations X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=0b941b759a94a242438ff51c414d8346856f6222;p=flightgear.git KLN89: Round properly when converting map points to pixel locations --- diff --git a/src/Instrumentation/KLN89/kln89.cxx b/src/Instrumentation/KLN89/kln89.cxx index 807c911ab..48b69a043 100644 --- a/src/Instrumentation/KLN89/kln89.cxx +++ b/src/Instrumentation/KLN89/kln89.cxx @@ -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);