diff options
author | tegzed <tegzed@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2011-02-19 20:24:43 +0000 |
---|---|---|
committer | tegzed <tegzed@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2011-02-19 20:24:43 +0000 |
commit | 452b6ea6279cb650ffb11464acd9b3569a49c030 (patch) | |
tree | c0def706b159bd51c8fea5aec029c6ff3fe7f896 /navit/osd/core | |
parent | 11e53005707acfce412127604537cd348793b806 (diff) | |
download | navit-452b6ea6279cb650ffb11464acd9b3569a49c030.tar.gz |
Fix:osd/core:fixed validity check for position change
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@4216 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/osd/core')
-rw-r--r-- | navit/osd/core/osd_core.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/navit/osd/core/osd_core.c b/navit/osd/core/osd_core.c index 284bbca47..eba7d85a0 100644 --- a/navit/osd/core/osd_core.c +++ b/navit/osd/core/osd_core.c @@ -370,11 +370,14 @@ osd_odometer_draw(struct odometer *this, struct navit *nav, osd_std_draw(&this->osd_item); if(this->bActive) { - vehicle_get_attr(curr_vehicle, attr_position_coord_geo,&position_attr, NULL); + if(!vehicle_get_attr(curr_vehicle, attr_position_coord_geo,&position_attr, NULL)) { + return; + } pro = projection_mg;//position_attr.u.pcoord->pro; transform_from_geo(pro, position_attr.u.coord_geo, &curr_coord); if (this->last_coord.x != -1 ) { + const double cStepDistLimit = 10000; struct timeval tv; double curr_time; gettimeofday(&tv,NULL); @@ -383,7 +386,7 @@ osd_odometer_draw(struct odometer *this, struct navit *nav, double dt = curr_time-this->last_update_time; double dCurrDist = 0; dCurrDist = transform_distance(pro, &curr_coord, &this->last_coord); - if(0<curr_coord.x && 0<this->last_coord.x) { + if(dCurrDist<=cStepDistLimit) { this->sum_dist += dCurrDist; } this->time_all = time(0)-this->last_click_time+this->sum_time; |