comparison gui/ui/main.c @ 36281:4e64c5384bce

Cosmetic: Don't shorten floating point constants that way.
author ib
date Tue, 30 Jul 2013 12:31:49 +0000
parents 7affacef2f88
children ebbd9730a8c6
comparison
equal deleted inserted replaced
36280:e160aade4b6d 36281:4e64c5384bce
151 btnModify( item->message,(float)( X - item->x ) / item->width * 100.0f ); 151 btnModify( item->message,(float)( X - item->x ) / item->width * 100.0f );
152 uiEvent( item->message,item->value ); 152 uiEvent( item->message,item->value );
153 value=item->value; 153 value=item->value;
154 break; 154 break;
155 case itVPotmeter: 155 case itVPotmeter:
156 btnModify( item->message, ( 1. - (float)( Y - item->y ) / item->height) * 100.0f ); 156 btnModify( item->message, ( 1.0 - (float)( Y - item->y ) / item->height) * 100.0f );
157 uiEvent( item->message,item->value ); 157 uiEvent( item->message,item->value );
158 value=item->value; 158 value=item->value;
159 break; 159 break;
160 } 160 }
161 uiEvent( item->message,value ); 161 uiEvent( item->message,value );
195 break; 195 break;
196 case itPotmeter: 196 case itPotmeter:
197 item->value=(float)( X - item->x ) / item->width * 100.0f; 197 item->value=(float)( X - item->x ) / item->width * 100.0f;
198 goto potihandled; 198 goto potihandled;
199 case itVPotmeter: 199 case itVPotmeter:
200 item->value=(1. - (float)( Y - item->y ) / item->height) * 100.0f; 200 item->value=(1.0 - (float)( Y - item->y ) / item->height) * 100.0f;
201 goto potihandled; 201 goto potihandled;
202 case itHPotmeter: 202 case itHPotmeter:
203 item->value=(float)( X - item->x ) / item->width * 100.0f; 203 item->value=(float)( X - item->x ) / item->width * 100.0f;
204 potihandled: 204 potihandled:
205 if ( item->value > 100.0f ) item->value=100.0f; 205 if ( item->value > 100.0f ) item->value=100.0f;