[MPlayer-cvslog] r36379 - in trunk/gui/ui: main.c playbar.c

ib subversion at mplayerhq.hu
Tue Jul 30 15:16:49 CEST 2013


Author: ib
Date: Tue Jul 30 15:16:49 2013
New Revision: 36379

Log:
Increase precision of calculation by using constants of type double.

Modified:
   trunk/gui/ui/main.c
   trunk/gui/ui/playbar.c

Modified: trunk/gui/ui/main.c
==============================================================================
--- trunk/gui/ui/main.c	Tue Jul 30 15:07:43 2013	(r36378)
+++ trunk/gui/ui/main.c	Tue Jul 30 15:16:49 2013	(r36379)
@@ -148,12 +148,12 @@ static void uiMainMouse( int Button,int 
            {
             case itPotmeter:
             case itHPotmeter:
-                 btnModify( item->message,(float)( X - item->x ) / item->width * 100.0f );
+                 btnModify( item->message,(float)( X - item->x ) / item->width * 100.0 );
 		 uiEvent( item->message,item->value );
                  value=item->value;
                  break;
 	    case itVPotmeter:
-                 btnModify( item->message, ( 1.0 - (float)( Y - item->y ) / item->height) * 100.0f );
+                 btnModify( item->message, ( 1.0 - (float)( Y - item->y ) / item->height) * 100.0 );
 		 uiEvent( item->message,item->value );
                  value=item->value;
                  break;
@@ -194,13 +194,13 @@ rollerhandled:
                  if (guiApp.menuIsPresent) guiApp.menuWindow.MouseHandler( 0,RX,RY,0,0 );
                  break;
             case itPotmeter:
-                 item->value=(float)( X - item->x ) / item->width * 100.0f;
+                 item->value=(float)( X - item->x ) / item->width * 100.0;
                  goto potihandled;
             case itVPotmeter:
-                 item->value=(1.0 - (float)( Y - item->y ) / item->height) * 100.0f;
+                 item->value=(1.0 - (float)( Y - item->y ) / item->height) * 100.0;
                  goto potihandled;
             case itHPotmeter:
-                 item->value=(float)( X - item->x ) / item->width * 100.0f;
+                 item->value=(float)( X - item->x ) / item->width * 100.0;
 potihandled:
                  if ( item->value > 100.0f ) item->value=100.0f;
                  if ( item->value < 0.0f ) item->value=0.0f;

Modified: trunk/gui/ui/playbar.c
==============================================================================
--- trunk/gui/ui/playbar.c	Tue Jul 30 15:07:43 2013	(r36378)
+++ trunk/gui/ui/playbar.c	Tue Jul 30 15:16:49 2013	(r36379)
@@ -177,12 +177,12 @@ static void uiPlaybarMouse( int Button, 
 	 {
 	  case itPotmeter:
 	  case itHPotmeter:
-	       btnModify( item->message,(float)( X - item->x ) / item->width * 100.0f );
+	       btnModify( item->message,(float)( X - item->x ) / item->width * 100.0 );
 	       uiEvent( item->message,item->value );
 	       value=item->value;
 	       break;
 	  case itVPotmeter:
-	       btnModify( item->message, ( 1.0 - (float)( Y - item->y ) / item->height) * 100.0f );
+	       btnModify( item->message, ( 1.0 - (float)( Y - item->y ) / item->height) * 100.0 );
 	       uiEvent( item->message,item->value );
 	       value=item->value;
 	       break;
@@ -215,13 +215,13 @@ rollerhandled:
 	       if (guiApp.menuIsPresent) guiApp.menuWindow.MouseHandler( 0,RX,RY,0,0 );
 	       break;
 	  case itPotmeter:
-	       item->value=(float)( X - item->x ) / item->width * 100.0f;
+	       item->value=(float)( X - item->x ) / item->width * 100.0;
 	       goto potihandled;
 	  case itVPotmeter:
-	       item->value=(1.0 - (float)( Y - item->y ) / item->height) * 100.0f;
+	       item->value=(1.0 - (float)( Y - item->y ) / item->height) * 100.0;
 	       goto potihandled;
 	  case itHPotmeter:
-	       item->value=(float)( X - item->x ) / item->width * 100.0f;
+	       item->value=(float)( X - item->x ) / item->width * 100.0;
 potihandled:
 	       if ( item->value > 100.0f ) item->value=100.0f;
 	       if ( item->value < 0.0f ) item->value=0.0f;


More information about the MPlayer-cvslog mailing list