1
0
Fork 0

Fix route-path hiding of waypoints

Also hide the path, if the preceding waypoint is hidden. Fixes the
route-manager test JonathanR added.
This commit is contained in:
James Turner 2020-07-02 12:19:10 +01:00
parent c3fce7e436
commit f97ea1f621

View file

@ -948,6 +948,14 @@ SGGeodVec RoutePath::pathForIndex(int index) const
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 {};
@ -961,7 +969,7 @@ SGGeodVec RoutePath::pathForIndex(int index) const
return pathForVia(static_cast<Via*>(d->waypoints[index].wpt.get()), index);
}
auto prevIt = d->previousValidWaypoint(index);
if (prevIt != d->waypoints.end()) {
prevIt->turnExitPath(r);