changeset 36941:865e0513b5f4

Remove redundant code. The only necessary call - uiEvent() - is performed after the switch statement anyway, so it isn't necessary to do this also in the case statement. The btnModify() calls are pointless, because these will be performed in the windows' draw handler prior to rendering anyway.
author ib
date Fri, 21 Mar 2014 15:46:15 +0000
parents 6410fe917eac
children 51c5ad2f0af3
files gui/ui/main.c gui/ui/playbar.c
diffstat 2 files changed, 4 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/gui/ui/main.c	Fri Mar 21 15:21:11 2014 +0000
+++ b/gui/ui/main.c	Fri Mar 21 15:46:15 2014 +0000
@@ -148,14 +148,10 @@
           switch( itemtype )
            {
             case itHPotmeter:
-                 btnModify( item->message,100.0 * ( X - item->x ) / item->width );
-		 uiEvent( item->message,item->value );
-                 value=item->value;
+                 value=100.0 * ( X - item->x ) / item->width;
                  break;
 	    case itVPotmeter:
-                 btnModify( item->message,100.0 - 100.0 * ( Y - item->y ) / item->height );
-		 uiEvent( item->message,item->value );
-                 value=item->value;
+                 value=100.0 - 100.0 * ( Y - item->y ) / item->height;
                  break;
            }
           uiEvent( item->message,value );
--- a/gui/ui/playbar.c	Fri Mar 21 15:21:11 2014 +0000
+++ b/gui/ui/playbar.c	Fri Mar 21 15:46:15 2014 +0000
@@ -177,14 +177,10 @@
 	switch( itemtype )
 	 {
 	  case itHPotmeter:
-	       btnModify( item->message,100.0 * ( X - item->x ) / item->width);
-	       uiEvent( item->message,item->value );
-	       value=item->value;
+	       value=100.0 * ( X - item->x ) / item->width;
 	       break;
 	  case itVPotmeter:
-	       btnModify( item->message,100.0 - 100.0 * ( Y - item->y ) / item->height );
-	       uiEvent( item->message,item->value );
-	       value=item->value;
+	       value=100.0 - 100.0 * ( Y - item->y ) / item->height;
 	       break;
 	 }
 	uiEvent( item->message,value );