Mercurial > mplayer.hg
diff gui/ui/playbar.c @ 36900:ecf965eee74d
Remove casts.
Make use of implicit arithmetic conversion
and increase precision at that.
author | ib |
---|---|
date | Wed, 12 Mar 2014 12:01:40 +0000 |
parents | eed2fb870f43 |
children | 97a16ac7f8dd |
line wrap: on
line diff
--- a/gui/ui/playbar.c Wed Mar 12 11:24:23 2014 +0000 +++ b/gui/ui/playbar.c Wed Mar 12 12:01:40 2014 +0000 @@ -177,12 +177,12 @@ { case itPotmeter: case itHPotmeter: - btnModify( item->message,(float)( X - item->x ) / item->width * 100.0 ); + btnModify( item->message,100.0 * ( X - item->x ) / item->width); uiEvent( item->message,item->value ); value=item->value; break; case itVPotmeter: - btnModify( item->message, ( 1.0 - (float)( Y - item->y ) / item->height) * 100.0 ); + btnModify( item->message,100.0 - 100.0 * ( Y - item->y ) / item->height ); uiEvent( item->message,item->value ); value=item->value; break; @@ -215,13 +215,13 @@ if (guiApp.menuIsPresent) guiApp.menuWindow.MouseHandler( 0,RX,RY,0,0 ); break; case itPotmeter: - item->value=(float)( X - item->x ) / item->width * 100.0; + item->value=100.0 * ( X - item->x ) / item->width; goto potihandled; case itVPotmeter: - item->value=(1.0 - (float)( Y - item->y ) / item->height) * 100.0; + item->value=100.0 - 100.0 * ( Y - item->y ) / item->height; goto potihandled; case itHPotmeter: - item->value=(float)( X - item->x ) / item->width * 100.0; + item->value=100.0 * ( X - item->x ) / item->width; potihandled: if ( item->value > 100.0f ) item->value=100.0f; if ( item->value < 0.0f ) item->value=0.0f;