Fix:core: Update route to use projections for tracking
authorzaxl <zaxl@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Fri, 7 Nov 2008 22:49:38 +0000 (22:49 +0000)
committerzaxl <zaxl@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Fri, 7 Nov 2008 22:49:38 +0000 (22:49 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@1682 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/navit/route.c

index b4e9df3..fa2abc0 100644 (file)
@@ -537,7 +537,7 @@ route_set_position(struct route *this, struct pcoord *pos)
 void
 route_set_position_from_tracking(struct route *this, struct tracking *tracking)
 {
-       struct coord *c;
+       struct pcoord *c;
        struct route_info *ret;
 
        dbg(2,"enter\n");
@@ -550,11 +550,13 @@ route_set_position_from_tracking(struct route *this, struct tracking *tracking)
        if (this->pos)
                route_info_free(this->pos);
        this->pos=NULL;
-       ret->c=*c;
-       ret->lp=*c;
+       ret->c.x = c->x;
+       ret->c.y = c->y;
+       ret->lp.x=c->x;
+       ret->lp.y=c->y;
        ret->pos=tracking_get_segment_pos(tracking);
        ret->street=street_data_dup(tracking_get_street_data(tracking));
-       route_info_distances(ret, projection_mg);
+       route_info_distances(ret, c->pro);
        dbg(3,"c->x=0x%x, c->y=0x%x pos=%d item=(0x%x,0x%x)\n", c->x, c->y, ret->pos, ret->street->item.id_hi, ret->street->item.id_lo);
        dbg(3,"street 0=(0x%x,0x%x) %d=(0x%x,0x%x)\n", ret->street->c[0].x, ret->street->c[0].y, ret->street->count-1, ret->street->c[ret->street->count-1].x, ret->street->c[ret->street->count-1].y);
        this->pos=ret;
@@ -604,7 +606,7 @@ route_rect(int order, struct coord *c1, struct coord *c2, int rel, int abs)
                d=dx*sx;
        else
                d=dy*sy;
-       m=d*rel/100+abs;        
+       m=d*rel/100+abs;
        sel->u.c_rect.lu.x-=m;
        sel->u.c_rect.rl.x+=m;
        sel->u.c_rect.lu.y+=m;