              emit instructionsChanged(banner_0, distance < show_at);
            }
          }
  
          // Handle transition to next route segment
          auto next_segment = segment.nextRouteSegment();
          if (next_segment.isValid()) {
            auto next_maneuver = next_segment.maneuver();
            if (next_maneuver.isValid()) {
              float next_maneuver_distance = next_maneuver.position().distanceTo(to_QGeoCoordinate(*last_position));
              // Switch to next route segment
              if (next_maneuver_distance < REROUTE_DISTANCE && next_maneuver_distance > last_maneuver_distance) {
                segment = next_segment;
  
                recompute_backoff = std::max(0, recompute_backoff - 1);
                recompute_countdown = 0;
              }
 
</s> remove         }
 </s> add  </s> remove             emit instructionsChanged(banner_0, distance < show_at);
 </s> add             emit instructionsChanged(banner_0, distance_to_maneuver < show_at); </s> remove             last_maneuver_distance = next_maneuver_distance;
          }
        } else {
          // Destination reached
          Params().remove("NavDestination");

          // Clear route if driving away from destination
          float d = segment.maneuver().position().distanceTo(to_QGeoCoordinate(*last_position));
          if (d > REROUTE_DISTANCE) {
            clearRoute();
 </s> add  </s> remove           float distance = std::max(0.0f, float(segment.distance()) - along_geometry);
          emit distanceChanged(distance);
 </s> add           float distance_to_maneuver = segment.distance() - along_geometry;
          emit distanceChanged(std::max(0.0f, distance_to_maneuver));
          // Transition to next route segment
          if (distance_to_maneuver < -MANEUVER_TRANSITION_THRESHOLD) {
            auto next_segment = segment.nextRouteSegment();
            if (next_segment.isValid()) {
              emit instructionsChanged(banner_0, distance < show_at);
            }
          }
  
          // Transition to next route segment
          if (distance_to_maneuver < -MANEUVER_TRANSITION_THRESHOLD) {
            auto next_segment = segment.nextRouteSegment();
            if (next_segment.isValid()) {
          // Transition to next route segment
          if (distance_to_maneuver < -MANEUVER_TRANSITION_THRESHOLD) {
            auto next_segment = segment.nextRouteSegment();
            if (next_segment.isValid()) {
          // Transition to next route segment
          if (distance_to_maneuver < -MANEUVER_TRANSITION_THRESHOLD) {
            auto next_segment = segment.nextRouteSegment();
            if (next_segment.isValid()) {
          // Transition to next route segment
          if (distance_to_maneuver < -MANEUVER_TRANSITION_THRESHOLD) {
            auto next_segment = segment.nextRouteSegment();
            if (next_segment.isValid()) {
          // Transition to next route segment
          if (distance_to_maneuver < -MANEUVER_TRANSITION_THRESHOLD) {
            auto next_segment = segment.nextRouteSegment();
            if (next_segment.isValid()) {
          // Transition to next route segment
          if (distance_to_maneuver < -MANEUVER_TRANSITION_THRESHOLD) {
            auto next_segment = segment.nextRouteSegment();
            if (next_segment.isValid()) {
          // Transition to next route segment
          if (distance_to_maneuver < -MANEUVER_TRANSITION_THRESHOLD) {
            auto next_segment = segment.nextRouteSegment();
            if (next_segment.isValid()) {
          // Transition to next route segment
          if (distance_to_maneuver < -MANEUVER_TRANSITION_THRESHOLD) {
            auto next_segment = segment.nextRouteSegment();
            if (next_segment.isValid()) {
                segment = next_segment;
  
                recompute_backoff = std::max(0, recompute_backoff - 1);
                recompute_countdown = 0;
              }
keep keep keep keep replace replace replace replace replace replace replace replace keep keep keep keep keep
 nav: simplify segment transition (#21383) 
selfdrive/ui/qt/maps/map.cc