From: Kaj-Michael Lang Date: Sat, 3 Nov 2007 15:06:37 +0000 (+0200) Subject: Don't use negative heading. Speak distance information only if we are centered on... X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ffb7000b2f20d40ebb7b86b7f4a06d11e041bcc6;p=mapper Don't use negative heading. Speak distance information only if we are centered on gps data. --- diff --git a/src/map.c b/src/map.c index d027167..2b1bfb4 100644 --- a/src/map.c +++ b/src/map.c @@ -1035,14 +1035,17 @@ gchar buffer[64]; if (_dest.valid) { dt=calculate_distance(lat, lon, _dest.lat, _dest.lon); dh=calculate_course(lat, lon, _dest.lat, _dest.lon); - snprintf(buffer, sizeof(buffer), "%.02f %s (%0.02f)", dt * UNITS_CONVERT[_units], UNITS_TEXT[_units], dh); + snprintf(buffer, sizeof(buffer), "%.02f %s (%0.02f)", dt * UNITS_CONVERT[_units], UNITS_TEXT[_units], dh<0 ? 360+dh : dh); gtk_label_set_label(GTK_LABEL(info_banner.distance), buffer); if (dt<0.005 && dest_reached==FALSE) { - speak_text("You have reached your destination."); + if (_center_mode>0) + speak_text("You have reached your destination."); dest_reached=TRUE; } else if (dt0) { + snprintf(buffer, sizeof(buffer), "Distance to destination: %.02f %s", dt * UNITS_CONVERT[_units], UNITS_TEXT[_units]); + speak_text(buffer); + } prev_dt=dt; } else if (dt>prev_dt+KM10KNOTS/4) { prev_dt=dt; @@ -1137,6 +1140,7 @@ press[0] = x; press[1] = y; before[0] = press[0]; before[1] = press[1]; +_center_mode=CENTER_MANUAL; map_drag_id=g_signal_connect(G_OBJECT(_map_widget), "motion_notify_event", G_CALLBACK(map_follow_move_cb), NULL); }