diff gui/win32/gui.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 049db0aeea85
children 40ad45360c8a
line wrap: on
line diff
--- a/gui/win32/gui.c	Wed Mar 12 11:24:23 2014 +0000
+++ b/gui/win32/gui.c	Wed Mar 12 12:01:40 2014 +0000
@@ -935,17 +935,17 @@
                         }
                         else item->x = GET_X_LPARAM(lParam) - gui->mousewx;
 
-                        item->value = ((item->x - item->wx) * 100.0f) / (float) wd;
+                        item->value = 100.0 * (item->x - item->wx) / wd;
                     }
                     if(item->type == tyVpotmeter)
                     {
                         item->y = GET_Y_LPARAM(lParam) - gui->mousewy;
-                        item->value = 100.0f - ((item->y - item->wy)  * 100.0f) / (float) (item->wheight - item->height);
+                        item->value = 100.0 - 100.0 * (item->y - item->wy) / (item->wheight - item->height);
                     }
                     if(item->type == tyPotmeter)
                     {
                         gui->mousewx = GET_X_LPARAM(lParam) - gui->activewidget->x;
-                        item->value = (gui->mousewx * 100.0f) / (float) item->wwidth;
+                        item->value = 100.0 * gui->mousewx / item->wwidth;
                     }
 
                     if((item->type == tyPotmeter) || (item->type == tyHpotmeter) || (item->type == tyVpotmeter))