diff --git a/src/Terrain/TerrainQuery.cc b/src/Terrain/TerrainQuery.cc index 7ed3105db189abf7a58474d31def3782f40c35ef..4ab20567a3ecf95ab3817dd1407bd494b16911c5 100644 --- a/src/Terrain/TerrainQuery.cc +++ b/src/Terrain/TerrainQuery.cc @@ -871,10 +871,10 @@ QPair, QList> UnitTestTerrainQuery::requestPathHei coordinates.push_back(fromCoord); //cast to pixels - long x0 = fromCoord.longitude()/one_second_deg; - long x1 = toCoord.longitude()/one_second_deg; - long y0 = fromCoord.latitude()/one_second_deg; - long y1 = toCoord.latitude()/one_second_deg; + long x0 = std::floor(fromCoord.longitude()/one_second_deg); + long x1 = std::floor(toCoord.longitude()/one_second_deg); + long y0 = std::floor(fromCoord.latitude()/one_second_deg); + long y1 = std::floor(toCoord.latitude()/one_second_deg); //bresenham line algo long dx = abs(x1-x0), sx = x0