From: arif Date: Fri, 16 Jul 2010 17:28:07 +0000 (+0000) Subject: attempt to rotation lag on mac X-Git-Tag: LAST_LIBGRAPH~32^2~1272 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=86129c98cbaa8cfe1ca31f372bd09b13dec55600;p=graphviz attempt to rotation lag on mac --- diff --git a/cmd/smyrna/gui/appmouse.c b/cmd/smyrna/gui/appmouse.c index 7ce9e1a51..4da883b73 100644 --- a/cmd/smyrna/gui/appmouse.c +++ b/cmd/smyrna/gui/appmouse.c @@ -36,15 +36,29 @@ static void apply_actions(ViewInfo* v,int x,int y) if (a==MM_ROTATE) { - view->arcball->MousePt.s.X = (GLfloat) x; - view->arcball->MousePt.s.Y = (GLfloat) y; - if (!view->arcball->isDragging) { - arcmouseClick(view); - view->arcball->isDragging = 1; + + + gdouble seconds; + seconds = g_timer_elapsed(view->timer3, NULL); + if (seconds > 1) { + g_timer_stop(view->timer2); + view->arcball->MousePt.s.X = (GLfloat) x; + view->arcball->MousePt.s.Y = (GLfloat) y; + if (!view->arcball->isDragging) { + arcmouseClick(view); + view->arcball->isDragging = 1; + } + else + arcmouseDrag(view); + g_timer_start(view->timer2); } - else - arcmouseDrag(view); + + return; + + + + } if (a==MM_PAN) { diff --git a/cmd/smyrna/smyrnadefs.h b/cmd/smyrna/smyrnadefs.h index 5340f43de..645376da5 100644 --- a/cmd/smyrna/smyrnadefs.h +++ b/cmd/smyrna/smyrnadefs.h @@ -668,6 +668,8 @@ typedef struct GTimer *timer; /*this timer is session timer and always active */ GTimer *timer2; + /*general purpose timer */ + GTimer *timer3; int active_frame; int total_frames; int frame_length; diff --git a/cmd/smyrna/viewport.c b/cmd/smyrna/viewport.c index 5b3fc9859..68274e5d2 100755 --- a/cmd/smyrna/viewport.c +++ b/cmd/smyrna/viewport.c @@ -484,6 +484,7 @@ void init_viewport(ViewInfo * view) /*create timer */ view->timer = g_timer_new(); view->timer2 = g_timer_new(); + view->timer3 = g_timer_new(); g_timer_stop(view->timer); view->active_frame = 0;