From: martin-s Date: Sat, 29 Dec 2007 10:55:13 +0000 (+0000) Subject: Fix:Core:Redraw map if route is created after vehicle update X-Git-Tag: navit-0.5.0.5194svn~4473 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=de5a8540763f8724afbd02e85da58035265e554f;p=profile%2Fivi%2Fnavit.git Fix:Core:Redraw map if route is created after vehicle update git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@678 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- diff --git a/navit/src/navit.c b/navit/src/navit.c index 8cf7454..3ccc09c 100644 --- a/navit/src/navit.c +++ b/navit/src/navit.c @@ -1168,6 +1168,7 @@ navit_vehicle_update(struct navit *this_, struct navit_vehicle *nv) struct point cursor_pnt, *pnt=&cursor_pnt; enum projection pro; int border=16; + int route_path_set=0; if (! this_->ready) return; @@ -1184,6 +1185,8 @@ navit_vehicle_update(struct navit *this_, struct navit_vehicle *nv) navit_vehicle_draw(this_, nv, NULL); return; } + if (this_->route) + route_path_set=route_get_path_set(this_->route); if (this_->tracking && this_->tracking_flag) { if (tracking_update(this_->tracking, &nv->coord, nv->dir)) { if (this_->route && nv->update_curr == 1) @@ -1197,7 +1200,6 @@ navit_vehicle_update(struct navit *this_, struct navit_vehicle *nv) route_set_position(this_->route, &cursor_pc); } } - transform(this_->trans, pro, &nv->coord, &cursor_pnt, 1, 0); if (!transform_within_border(this_->trans, &cursor_pnt, border)) { if (!this_->cursor_flag) @@ -1219,6 +1221,8 @@ navit_vehicle_update(struct navit *this_, struct navit_vehicle *nv) navit_set_center_cursor(this_, &nv->coord, nv->dir, 50, 80); pnt=NULL; } + if (pnt && this_->route && !route_path_set && route_get_path_set(this_->route)) + navit_draw(this_); if (nv->follow_curr > 1) nv->follow_curr--; else diff --git a/navit/src/route.c b/navit/src/route.c index 61dac6d..7d4866a 100644 --- a/navit/src/route.c +++ b/navit/src/route.c @@ -188,6 +188,12 @@ route_get_speedlist(struct route *this) } int +route_get_path_set(struct route *this) +{ + return this->path2 != NULL; +} + +int route_set_speed(struct route *this, enum item_type type, int value) { if (type < route_item_first || type > route_item_last) { diff --git a/navit/src/route.h b/navit/src/route.h index 06575e0..d6a60b4 100644 --- a/navit/src/route.h +++ b/navit/src/route.h @@ -43,6 +43,7 @@ struct mapset *route_get_mapset(struct route *this); struct route_info *route_get_pos(struct route *this); struct route_info *route_get_dst(struct route *this); int *route_get_speedlist(struct route *this); +int route_get_path_set(struct route *this); int route_set_speed(struct route *this, enum item_type type, int value); int route_contains(struct route *this, struct item *item); void route_set_position(struct route *this, struct pcoord *pos);