From 972a50c637501749b82645fa999b482844e0aac5 Mon Sep 17 00:00:00 2001 From: Paolo Ventafridda Date: Mon, 5 Dec 2016 16:24:21 +0100 Subject: [PATCH] Fix bug in Flarm display objects on moving map: max 10 objects should be accounted only when really painted, depending if they are really on the current map considering zoom and location. --- Common/Source/Draw/LKDrawFLARMTraffic.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Common/Source/Draw/LKDrawFLARMTraffic.cpp b/Common/Source/Draw/LKDrawFLARMTraffic.cpp index 4762e005c1..fb8cc5fe28 100644 --- a/Common/Source/Draw/LKDrawFLARMTraffic.cpp +++ b/Common/Source/Draw/LKDrawFLARMTraffic.cpp @@ -93,7 +93,6 @@ static int iRectangleSize = 4; if ( (DrawInfo.FLARM_Traffic[i].ID !=0) && (DrawInfo.FLARM_Traffic[i].Status != LKT_ZOMBIE) ) { - painted++; double target_lon; double target_lat; @@ -101,6 +100,13 @@ static int iRectangleSize = 4; target_lon = DrawInfo.FLARM_Traffic[i].Longitude; target_lat = DrawInfo.FLARM_Traffic[i].Latitude; + if (!PointVisible(target_lon, target_lat)) { + // StartupStore(_T("... This traffic is not visible on map with current zoom%s"),NEWLINE); + continue; + } + + painted++; + #if (0) // No scaling, wrong if ((EnableFLARMMap==2)&&(scalefact>1.0)) {