From 8429cf6a3b1c5365b07dbf421f784ca041825f06 Mon Sep 17 00:00:00 2001 From: DoinLakeFlyer Date: Sat, 22 Feb 2020 10:00:32 -0800 Subject: [PATCH] Fix waypoint linkage to first item --- src/MissionManager/MissionController.cc | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/MissionManager/MissionController.cc b/src/MissionManager/MissionController.cc index 6287aebe4..bd8d14091 100644 --- a/src/MissionManager/MissionController.cc +++ b/src/MissionManager/MissionController.cc @@ -1308,18 +1308,20 @@ void MissionController::_recalcWaypointLines(void) startVIForIncompleteItem = visualItem; } - if (i != 1 && (lastCoordinateItemBeforeRTL != _settingsItem || (homePositionValid && linkStartToHome))) { - // Direction arrows are added to the second segment and every 5 segments thereafter. - // The reason for start with second segment is to prevent an arrow being added in between the home position - // and a takeoff item which may be right over each other. In that case the arrow points in a random direction. + if (lastCoordinateItemBeforeRTL != _settingsItem || (homePositionValid && linkStartToHome)) { bool addDirectionArrow = false; - if (firstCoordinateNotFound || !lastCoordinateItemBeforeRTL->isSimpleItem() || !visualItem->isSimpleItem()) { - addDirectionArrow = true; - } else if (segmentCount > 5) { - segmentCount = 0; - addDirectionArrow = true; + if (i != 1) { + // Direction arrows are added to the second segment and every 5 segments thereafter. + // The reason for start with second segment is to prevent an arrow being added in between the home position + // and a takeoff item which may be right over each other. In that case the arrow points in a random direction. + if (firstCoordinateNotFound || !lastCoordinateItemBeforeRTL->isSimpleItem() || !visualItem->isSimpleItem()) { + addDirectionArrow = true; + } else if (segmentCount > 5) { + segmentCount = 0; + addDirectionArrow = true; + } + segmentCount++; } - segmentCount++; lastSegmentVisualItemPair = VisualItemPair(lastCoordinateItemBeforeRTL, visualItem); if (!_flyView || addDirectionArrow) { -- 2.22.0