]> err.no Git - mapper/commitdiff
Changes to how mouse button works. Pan with button down, double click centers.
authorKaj-Michael Lang <milang@tal.org>
Fri, 2 Nov 2007 22:43:37 +0000 (00:43 +0200)
committerKaj-Michael Lang <milang@tal.org>
Fri, 2 Nov 2007 22:43:37 +0000 (00:43 +0200)
src/map.c

index 3247d0153185a02e37914cc2b3e5d9965e996d15..d027167bd90b521c06164241624ff0691407800e 100644 (file)
--- a/src/map.c
+++ b/src/map.c
@@ -1167,14 +1167,15 @@ _cmenu_position_y = event->y + 0.5;
 switch (event->button) {
 case 1:
        if (event->type==GDK_2BUTTON_PRESS) {
-               map_set_zoom(_zoom - 1);
+               map_center_unit(x2unit((gint) (event->x + 0.5)), y2unit((gint) (event->y + 0.5)));
                return FALSE;
        }
        if (event->type==GDK_3BUTTON_PRESS)
                return FALSE;
+       map_drag_start(event->x, event->y);
 break;
 case 2:
-       map_drag_start(event->x, event->y);
+       map_set_zoom(_zoom - 1);
 break;
 case 3:
 #ifndef WITH_HILDON
@@ -1206,14 +1207,14 @@ case 1:
        case MAP_MODE_SET_ROUTE_TO:
        break;
        default:
+               map_drag_stop(event->x, event->y);
+               map_render_data();
        break;
        }
-       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)));
+       g_idle_add_full(G_PRIORITY_HIGH_IDLE,(GSourceFunc)map_update_location_from_center, NULL, NULL);
 break;
 case 2:
-       map_drag_stop(event->x, event->y);
-       map_render_data();      
+       /* */
 break;
 case 3:
 break;