summaryrefslogtreecommitdiff
path: root/navit/navit.c
diff options
context:
space:
mode:
authorsleske <sleske@ffa7fe5e-494d-0410-b361-a75ebd5db220>2012-10-22 19:41:14 +0000
committersleske <sleske@ffa7fe5e-494d-0410-b361-a75ebd5db220>2012-10-22 19:41:14 +0000
commit7f1798496498f01ff321abf4e5c6c3f818b7da05 (patch)
treed127e3e4ef65b0c1762c071ad96cf692c6982462 /navit/navit.c
parentc83664ec1e18331f9fdd03c8beec5e826ebbb4e9 (diff)
downloadnavit-svn-7f1798496498f01ff321abf4e5c6c3f818b7da05.tar.gz
Fix:core:Remove incomplete and disabled code for map rotation (from rev.1856, "Add:Core:Made rotation of maps by dragging possible"). See trac #xxx.
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@5252 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/navit.c')
-rw-r--r--navit/navit.c33
1 files changed, 5 insertions, 28 deletions
diff --git a/navit/navit.c b/navit/navit.c
index 4af07bd2..6da9eaa7 100644
--- a/navit/navit.c
+++ b/navit/navit.c
@@ -388,22 +388,13 @@ navit_ignore_graphics_events(struct navit *this_, int ignore)
this_->ignore_graphics_events=ignore;
}
-static void
-update_transformation(struct transformation *tr, struct point *old, struct point *new, struct point *rot)
+void
+update_transformation(struct transformation *tr, struct point *old, struct point *new)
{
struct coord co,cn;
struct coord c,*cp;
- int yaw;
- double angleo,anglen;
-
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);
- }
if (!transform_reverse(tr, new, &cn))
return;
cp=transform_get_center(tr);
@@ -471,14 +462,7 @@ navit_handle_button(struct navit *this_, int pressed, int button, struct point *
this_->motion_timeout=NULL;
}
if (this_->moved) {
- struct point pr;
- pr.x=this_->w/2;
- pr.y=this_->h;
-#if 0
- update_transformation(this_->trans, &this_->pressed, p, &pr);
-#else
- update_transformation(this_->trans, &this_->pressed, p, NULL);
-#endif
+ update_transformation(this_->trans, &this_->pressed, p);
graphics_draw_drag(this_->gra, NULL);
transform_copy(this_->trans, this_->trans_cursor);
graphics_overlay_disable(this_->gra, 0);
@@ -525,17 +509,10 @@ navit_motion_timeout(struct navit *this_)
dy=(this_->current.y-this_->last.y);
if (dx || dy) {
struct transformation *tr;
- struct point pr;
this_->last=this_->current;
graphics_overlay_disable(this_->gra, 1);
tr=transform_dup(this_->trans);
- pr.x=this_->w/2;
- pr.y=this_->h;
-#if 0
- update_transformation(tr, &this_->pressed, &this_->current, &pr);
-#else
- update_transformation(tr, &this_->pressed, &this_->current, NULL);
-#endif
+ update_transformation(tr, &this_->pressed, &this_->current);
#if 0
graphics_displaylist_move(this_->displaylist, dx, dy);
#endif
@@ -2225,7 +2202,7 @@ navit_set_center_coord_screen(struct navit *this_, struct coord *c, struct point
transform_get_size(this_->trans, &width, &height);
po.x=width/2;
po.y=height/2;
- update_transformation(this_->trans, &po, p, NULL);
+ update_transformation(this_->trans, &po, p);
if (set_timeout)
navit_set_timeout(this_);
}