Fix:Core:Avoid dragging the map from/to illegal positions
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Sat, 21 Nov 2009 07:26:04 +0000 (07:26 +0000)
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Sat, 21 Nov 2009 07:26:04 +0000 (07:26 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@2777 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/navit/navit.c

index 8f7283d..63f6398 100644 (file)
@@ -315,14 +315,16 @@ update_transformation(struct transformation *tr, struct point *old, struct point
        int yaw;
        double angleo,anglen;
 
-       transform_reverse(tr, old, &co);
+       if (!transform_reverse(tr, old, &co))
+               return;
        if (rot) {
                angleo=atan2(old->y-rot->y, old->x-rot->x)*180/M_PI;
                anglen=atan2(new->y-rot->y, new->x-rot->x)*180/M_PI;
                yaw=transform_get_yaw(tr)+angleo-anglen;
                transform_set_yaw(tr, yaw % 360);
        }
-       transform_reverse(tr, new, &cn);
+       if (!transform_reverse(tr, new, &cn))
+               return;
        cp=transform_get_center(tr);
        c.x=cp->x+co.x-cn.x;
        c.y=cp->y+co.y-cn.y;