Fix:core:Use latest mouse position for dragging after release of button
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Wed, 18 Jun 2008 21:42:02 +0000 (21:42 +0000)
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Wed, 18 Jun 2008 21:42:02 +0000 (21:42 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@1144 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/navit/navit.c

index 399e1a7..c04b111 100644 (file)
@@ -264,13 +264,14 @@ navit_handle_button(struct navit *this_, int pressed, int button, struct point *
                        this_->motion_timeout=0;
                }
                if (this_->moved) {
-                       struct point p;
-                       transform_get_size(this_->trans, &p.x, &p.y);
-                       p.x/=2;
-                       p.y/=2;
-                       p.x-=this_->last.x-this_->pressed.x;
-                       p.y-=this_->last.y-this_->pressed.y;
-                       navit_set_center_screen(this_, &p);
+                       struct point pt;
+                       this_->last=*p;
+                       transform_get_size(this_->trans, &pt.x, &pt.y);
+                       pt.x/=2;
+                       pt.y/=2;
+                       pt.x-=this_->last.x-this_->pressed.x;
+                       pt.y-=this_->last.y-this_->pressed.y;
+                       navit_set_center_screen(this_, &pt);
                } else
                        return 1;
        }