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

@ -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<Via*>(d->waypoints[index].wpt.get()), index);
}
auto prevIt = d->previousValidWaypoint(index);
if (prevIt != d->waypoints.end()) {
prevIt->turnExitPath(r);