diff --git a/src/MissionManager/TransectStyleComplexItem.cc b/src/MissionManager/TransectStyleComplexItem.cc index 6f26026860e20ed6e2a1734422e8aff0f5b72aac..97badaf2ddb9e4e6ffd0cfe3d61ce68d8b31a003 100644 --- a/src/MissionManager/TransectStyleComplexItem.cc +++ b/src/MissionManager/TransectStyleComplexItem.cc @@ -611,7 +611,7 @@ void TransectStyleComplexItem::_addInterstitialTerrainPoints(QList& { QList adjustedTransect; - adjustedTransect.append(transect.first()); + double requestedAltitude = _cameraCalc.distanceToSurface()->rawValue().toDouble(); for (int i=0; i& double distance = fromCoordInfo.coord.distanceTo(toCoordInfo.coord); const TerrainPathQuery::PathHeightInfo_t& pathHeightInfo = transectPathHeightInfo[i]; - double requestedAltitude = _cameraCalc.distanceToSurface()->rawValue().toDouble(); fromCoordInfo.coord.setAltitude(pathHeightInfo.heights.first() + requestedAltitude); toCoordInfo.coord.setAltitude(pathHeightInfo.heights.last() + requestedAltitude); + if (i == 0) { + adjustedTransect.append(fromCoordInfo); + } + int cHeights = pathHeightInfo.heights.count(); for (int pathHeightIndex=1; pathHeightIndex& adjustedTransect.append(toCoordInfo); } + CoordInfo_t lastCoordInfo = transect.last(); + const TerrainPathQuery::PathHeightInfo_t& pathHeightInfo = transectPathHeightInfo.last(); + lastCoordInfo.coord.setAltitude(pathHeightInfo.heights.last() + requestedAltitude); + adjustedTransect.append(lastCoordInfo); + #if 0 qDebug() << "_addInterstitialTerrainPoints"; foreach (const TransectStyleComplexItem::CoordInfo_t& coordInfo, adjustedTransect) {