From 406e3c2ab2c0a8924b8770f1b767fcf2594bc873 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Thu, 21 Jul 2022 18:20:15 -0700 Subject: [PATCH] smyrna toolboxcallbacks: remove unnecessary parens This also adjusts the location of some variable definitions to C99 style. --- cmd/smyrna/gui/toolboxcallbacks.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/cmd/smyrna/gui/toolboxcallbacks.c b/cmd/smyrna/gui/toolboxcallbacks.c index 5ddaf1b22..ff62a3fbc 100644 --- a/cmd/smyrna/gui/toolboxcallbacks.c +++ b/cmd/smyrna/gui/toolboxcallbacks.c @@ -28,17 +28,17 @@ void btnToolZoomFit_clicked(GtkWidget * widget, gpointer user_data) (void)widget; (void)user_data; - float z, GDX, SDX, GDY, SDY; + float z; (view->active_camera >= 0) ? (z = view->cameras[view->active_camera]->r) : (z = view->zoom * -1); - GDX = (view->bdxRight / z - view->bdxLeft / z); - SDX = (view->clipX2 - view->clipX1); - GDY = (view->bdyTop / z - view->bdyBottom / z); - SDY = (view->clipY2 - view->clipY1); + float GDX = view->bdxRight / z - view->bdxLeft / z; + float SDX = view->clipX2 - view->clipX1; + float GDY = view->bdyTop / z - view->bdyBottom / z; + float SDY = view->clipY2 - view->clipY1; - if ((SDX / GDX) <= (SDY / GDY)) { + if (SDX / GDX <= SDY / GDY) { (view->active_camera >= 0) ? (view->cameras[view->active_camera]->r = view->cameras[view->active_camera]->r / (SDX / @@ -83,8 +83,8 @@ void btnToolFit_clicked(GtkWidget * widget, gpointer user_data) view->cameras[view->active_camera]->targetx += (gcx - scx); view->cameras[view->active_camera]->targety += (gcx - scy); } else { - view->panx += (gcx - scx); - view->pany += (gcy - scy); + view->panx += gcx - scx; + view->pany += gcy - scy; } view->Topview->fitin_zoom = view->zoom; -- 2.40.0