From bfa612e2e5ae5c75304827bca7be4cdc82587fcd Mon Sep 17 00:00:00 2001 From: Kaj-Michael Lang Date: Tue, 5 Feb 2008 17:06:27 +0200 Subject: [PATCH] Don't start downloads when dragging, do a full redraw at end of drag. --- src/map.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/map.c b/src/map.c index d05908e..996e30e 100644 --- a/src/map.c +++ b/src/map.c @@ -117,8 +117,8 @@ static GTimer *map_timer; #define KM10KNOTS (5.39956803) -void map_render_paths(); -void map_force_redraw(); +void map_render_paths(void); +void map_force_redraw(void); void map_draw_position_icon(Position *pos); static void map_update_location(gdouble lat, gdouble lon, gboolean force); @@ -555,7 +555,7 @@ if (new_base_tilex != _base_tilex || new_base_tiley != _base_tiley) { new_base_tiley + new_y, new_x * TILE_SIZE_PIXELS, new_y * TILE_SIZE_PIXELS, - FALSE); + map_drag_id!=0 ? TRUE : FALSE); } } } @@ -839,7 +839,7 @@ map_follow_move_cb(GtkWidget *widget, GdkEventMotion *event, gpointer data) { GdkModifierType state; gint xx, yy; -guint unitx, unity; +guint unitx, unity, nunitx, nunity; guint cx, cy; if (!(event->state & GDK_BUTTON1_MASK)) @@ -859,9 +859,12 @@ unity = y2unit((gint) (yy - before[1])); cx = unit2x(_center.unitx); cy = unit2y(_center.unity); -map_center_unit(x2unit((gint) (cx - (xx - before[0]))), y2unit((gint) (cy - (yy - before[1])))); -map_data_needs_refresh=TRUE; +nunitx=x2unit((gint) (cx - (xx - before[0]))); +nunity=y2unit((gint) (cy - (yy - before[1]))); + +map_center_unit(nunitx, nunity); +g_debug("MAP PAN: %d %d %d %d (%d, %d)", cx, cy, xx, yy, nunitx, nunity); before[0] = xx; before[1] = yy; return FALSE; @@ -1268,6 +1271,7 @@ release[1]=0; before[0]=0; before[1]=0; map_drag_id=0; +map_force_redraw(); } /* Workaround hildon content menu problem */ -- 2.39.5