From: Kaj-Michael Lang Date: Thu, 2 Aug 2007 14:14:09 +0000 (+0300) Subject: Update mouse click location every time. Limit the autozoomer to level 5. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bcac2cfa4fd5595d5833f41f61edb5cce13d22d4;p=mapper Update mouse click location every time. Limit the autozoomer to level 5. --- diff --git a/src/map.c b/src/map.c index fe56b38..59c1c66 100644 --- a/src/map.c +++ b/src/map.c @@ -100,8 +100,7 @@ gboolean curl_download_timeout() CURLMsg *msg; vprintf("%s()\n", __PRETTY_FUNCTION__); - if (_curl_multi && CURLM_CALL_MULTI_PERFORM - == curl_multi_perform(_curl_multi, &num_transfers)) + if (_curl_multi && CURLM_CALL_MULTI_PERFORM == curl_multi_perform(_curl_multi, &num_transfers)) return TRUE; /* Give UI a chance first. */ while (_curl_multi && (msg = curl_multi_info_read(_curl_multi, &num_msgs))) { @@ -1334,19 +1333,21 @@ int map_zoom(gint zdir) static gboolean map_autozoomer() { -static gfloat z=6.0; -static gint last=6; +static gfloat z=5.0; +static gint last=5; gint iz; if (_zoom_timeout_sid==0) return FALSE; -z=(z+_gps.speed+1)/2; -if (z>7) z=7.0; else if (z<1) z=1.0; +z=(z+_gps.speed+1)/3; +if (z>5) z=5.0; else if (z<1) z=1.0; iz=(gint)roundf(z); g_printf("Setting autozoom to: %f %d S:%f\n", z, iz, _gps.speed); -if (iz>last) iz=last+1; -else if (izlast) + iz=last+1; +else if (izx + 0.5; + _cmenu_position_y = event->y + 0.5; + switch (event->button) { case 1: if (event->type == GDK_2BUTTON_PRESS) { @@ -1515,8 +1519,6 @@ gboolean map_cb_button_press(GtkWidget * widget, GdkEventButton * event) G_CALLBACK(map_follow_move), NULL); break; case 3: - _cmenu_position_x = event->x + 0.5; - _cmenu_position_y = event->y + 0.5; #ifndef WITH_HILDON gtk_menu_popup(GTK_MENU(_menu_map), NULL, NULL, NULL, NULL, event->button, gtk_get_current_event_time()); @@ -1561,7 +1563,6 @@ gboolean map_cb_button_release(GtkWidget * widget, GdkEventButton * event) g_idle_add((GSourceFunc)map_update_location_from_center, NULL); - map_center_unit(x2unit((gint) (event->x + 0.5)), y2unit((gint) (event->y + 0.5)));