From ca94597e90e3bcbe8b95898d076b516fb64b0b0e Mon Sep 17 00:00:00 2001 From: martin-s Date: Thu, 20 Dec 2007 21:17:44 +0000 Subject: [PATCH] More bugfixes git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@658 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- navit/src/navit.c | 5 ----- navit/src/navit.xml | 2 +- navit/src/transform.c | 7 +++---- navit/src/transform.h | 8 ++++---- 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/navit/src/navit.c b/navit/src/navit.c index 0b17b3e..b810fb8 100644 --- a/navit/src/navit.c +++ b/navit/src/navit.c @@ -211,9 +211,7 @@ navit_button(void *data, int pressed, int button, struct point *p) } if (this_->moved) { struct point p; -#if 0 transform_get_size(this_->trans, &p.x, &p.y); -#endif p.x/=2; p.y/=2; p.x-=this_->last.x-this_->pressed.x; @@ -1056,7 +1054,6 @@ navit_set_center(struct navit *this_, struct coord *center) static void navit_set_center_cursor(struct navit *this_, struct coord *cursor, int dir, int xpercent, int ypercent) { -#if 0 struct coord *c=transform_center(this_->trans); int width, height; struct point p; @@ -1071,8 +1068,6 @@ navit_set_center_cursor(struct navit *this_, struct coord *cursor, int dir, int *c=cnew; if (this_->ready) navit_draw(this_); -#endif - } diff --git a/navit/src/navit.xml b/navit/src/navit.xml index ffe6546..5191aad 100644 --- a/navit/src/navit.xml +++ b/navit/src/navit.xml @@ -1,7 +1,7 @@ - + diff --git a/navit/src/transform.c b/navit/src/transform.c index 2d11a7b..d4dab91 100644 --- a/navit/src/transform.c +++ b/navit/src/transform.c @@ -277,14 +277,13 @@ transform_set_size(struct transformation *t, int width, int height) } #endif -#if 0 void transform_get_size(struct transformation *t, int *width, int *height) { - *width=t->width; - *height=t->height; + struct coord_rect *r=&t->screen_sel->u.p_rect; + *width=r->rl.x-r->lu.y; + *height=r->rl.y-r->lu.y; } -#endif void transform_setup(struct transformation *t, struct pcoord *c, int scale, int angle) diff --git a/navit/src/transform.h b/navit/src/transform.h index b49485e..d06075b 100644 --- a/navit/src/transform.h +++ b/navit/src/transform.h @@ -9,6 +9,7 @@ enum projection; struct coord; struct coord_geo; struct map_selection; +struct pcoord; struct point; struct transformation; struct transformation *transform_new(void); @@ -18,10 +19,13 @@ int transform(struct transformation *t, enum projection pro, struct coord *c, st void transform_reverse(struct transformation *t, struct point *p, struct coord *c); enum projection transform_get_projection(struct transformation *this_); void transform_set_projection(struct transformation *this_, enum projection pro); +struct map_selection *transform_get_selection(struct transformation *this_, enum projection pro, int order); struct coord *transform_center(struct transformation *this_); void transform_set_angle(struct transformation *t, int angle); int transform_get_angle(struct transformation *this_, int angle); void transform_set_screen_selection(struct transformation *t, struct map_selection *sel); +void transform_get_size(struct transformation *t, int *width, int *height); +void transform_setup(struct transformation *t, struct pcoord *c, int scale, int angle); void transform_setup_source_rect(struct transformation *t); long transform_get_scale(struct transformation *t); void transform_set_scale(struct transformation *t, long scale); @@ -33,10 +37,6 @@ int transform_distance_sq(struct coord *c1, struct coord *c2); int transform_distance_line_sq(struct coord *l0, struct coord *l1, struct coord *ref, struct coord *lpnt); int transform_distance_polyline_sq(struct coord *c, int count, struct coord *ref, struct coord *lpnt, int *pos); void transform_print_deg(double deg); -int transform_contains_polygon(struct transformation *t, struct coord *c, int count); -int transform_contains_polyline(struct transformation *t, struct coord *c, int count); -int transform_contains_point(struct transformation *t, struct coord *c); -int is_too_small(struct transformation *t, struct coord *c, int limit); int transform_get_angle_delta(struct coord *c1, struct coord *c2, int dir); int transform_within_border(struct transformation *this_, struct point *p, int border); /* end of prototypes */ -- 2.7.4