From f97ea1f62164b3feb91b6fde92a259330268efe1 Mon Sep 17 00:00:00 2001 From: James Turner Date: Thu, 2 Jul 2020 12:19:10 +0100 Subject: [PATCH] Fix route-path hiding of waypoints Also hide the path, if the preceding waypoint is hidden. Fixes the route-manager test JonathanR added. --- src/Navaids/routePath.cxx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/Navaids/routePath.cxx b/src/Navaids/routePath.cxx index ed626e3a4..82ee9961b 100644 --- a/src/Navaids/routePath.cxx +++ b/src/Navaids/routePath.cxx @@ -947,7 +947,15 @@ SGGeodVec RoutePath::pathForIndex(int index) const if (w.wpt->flag(WPT_HIDDEN)) { return {}; } - + + // also hide the path if the prev WP is hidden + auto prevIt = d->previousValidWaypoint(index); + if (prevIt != d->waypoints.end()) { + if (prevIt->wpt->flag(WPT_HIDDEN)) { + return {}; + } + } + if (ty == "vectors") { // ideally we'd show a stippled line to connect the route? return {}; @@ -960,8 +968,8 @@ SGGeodVec RoutePath::pathForIndex(int index) const if (ty == "via") { return pathForVia(static_cast(d->waypoints[index].wpt.get()), index); } - - auto prevIt = d->previousValidWaypoint(index); + + if (prevIt != d->waypoints.end()) { prevIt->turnExitPath(r);