From 47a458b5345994584dc6f4959cbd3c0907f6782e Mon Sep 17 00:00:00 2001 From: arif Date: Thu, 17 Apr 2008 15:35:47 +0000 Subject: [PATCH] zoom abnormality is fixed, no more losing the sight of the graph while zooming --- cmd/smyrna/glmotion.c | 23 +++++++++++++++++++++++ cmd/smyrna/topview.c | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/cmd/smyrna/glmotion.c b/cmd/smyrna/glmotion.c index d934f3bc7..46f381ed5 100644 --- a/cmd/smyrna/glmotion.c +++ b/cmd/smyrna/glmotion.c @@ -103,6 +103,29 @@ int glmotion_pan(ViewInfo * v) redraw = TRUE; } +int glmotion_adjust_pan(ViewInfo* v,float panx,float pany) +{ + float gldx,gldy; + if(v->active_camera ==-1) + { + gldx=GetOGLDistance(panx)/v->zoom*-1; + gldy=GetOGLDistance(pany)/v->zoom*-1; + v->panx=v->panx-gldx; + v->pany=v->pany+gldy; + } + else + { + gldx=GetOGLDistance(panx)/v->cameras[v->active_camera]->r; + gldy=GetOGLDistance(pany)/v->cameras[v->active_camera]->r; + v->cameras[v->active_camera]->x-=gldx; + v->cameras[v->active_camera]->y-=gldy; + v->cameras[v->active_camera]->targetx-=gldx; + v->cameras[v->active_camera]->targety+=gldy; + } + + redraw = TRUE; + +} int glmotion_rotate(ViewInfo * v) { v->cameras[v->active_camera]->angley-=v->mouse.dy/5; diff --git a/cmd/smyrna/topview.c b/cmd/smyrna/topview.c index 166eeaec8..4c05e6ed3 100755 --- a/cmd/smyrna/topview.c +++ b/cmd/smyrna/topview.c @@ -1317,7 +1317,7 @@ void drawtopologicalfisheye(topview* t) glVertex3f((GLfloat)x0,(GLfloat)y0,(GLfloat)0); glVertex3f((GLfloat)x,(GLfloat)y,(GLfloat)0); } - } + } else if (gg[n].active_level > level) { find_physical_coords(hp, level, n, &x, &y); glVertex3f((GLfloat)x0,(GLfloat)y0,(GLfloat)0); -- 2.40.0