]> granicus.if.org Git - graphviz/commitdiff
mouse wheel issue..third attempt....get fixed already!!!!!
authorarif <devnull@localhost>
Thu, 4 Jun 2009 19:13:34 +0000 (19:13 +0000)
committerarif <devnull@localhost>
Thu, 4 Jun 2009 19:13:34 +0000 (19:13 +0000)
cmd/smyrna/gltemplate.c
cmd/smyrna/smyrnadefs.h
cmd/smyrna/viewport.c

index 21149870a199531a36e60babb741f7a6270457a5..c68810ca7742d3dcfb009093f85afd420393827f 100755 (executable)
@@ -393,16 +393,23 @@ static gboolean button_release_event(GtkWidget * widget,
 static gboolean
 scroll_event(GtkWidget * widget, GdkEventScroll * event, gpointer data)
 {
-       g_signal_handlers_disconnect_by_func(G_OBJECT(view->drawing_area),scroll_event,NULL);
-       if(event->direction==0)
-           view->mouse.dx = -30;
-       if(event->direction==1)
-           view->mouse.dx = 30;
-       glmotion_zoom(view);
-       glexpose();
-//     g_signal_handlers_unblock_by_func(G_OBJECT(view->drawing_area),scroll_event,NULL);
-    g_signal_connect(G_OBJECT(view->drawing_area), "scroll_event",G_CALLBACK(scroll_event), NULL);
+       gdouble seconds;
+       static int callcount=0;
 
+       int fr;
+       seconds=g_timer_elapsed(view->timer2,NULL);
+       if (seconds > 0.005)
+       {
+               g_timer_stop(view->timer2);
+               if(event->direction==0)
+                       view->mouse.dx=-30;
+               if(event->direction==1)
+                       view->mouse.dx=+30;
+               glmotion_zoom(view);
+               glexpose();
+               g_timer_start(view->timer2);
+
+       }
        return TRUE;
 }
 
index ec7e1f0bfee82bc0c4c9e863adce76fc235534fb..6109a4281a35fa6f37d5c023afe69003a57506df 100644 (file)
@@ -516,6 +516,8 @@ typedef struct _ViewInfo
        Agraph_t* default_attributes;
        /*timer for animations*/
        GTimer* timer;
+       /*this timer is session timer and always active*/
+       GTimer* timer2;
        int active_frame;
        int total_frames;
        int frame_length;
index 7f0eaff1806851ce42a19941b49be2e9a40d4bed..2e4a01dc32775999fe09b8d76d13f35a28534f28 100755 (executable)
@@ -451,6 +451,8 @@ void init_viewport(ViewInfo * view)
     view->Topview->parms.repos.distortion = 1.0;
        /*create timer*/
        view->timer=g_timer_new();
+       view->timer2=g_timer_new();
+
        g_timer_stop(view->timer); 
        view->active_frame=0;
        view->total_frames=1500;