changeset 36963:e539d330c7be

Remove unnecessary bounds checks in Win32 GUI. The checks that the rendered potmeter button doesn't exceed the bounds is not necessary as the item value is already limited within the range of 0 to 100. Patch by Hans-Dieter Kosch, hdkosch kabelbw de.
author ib
date Mon, 24 Mar 2014 12:52:01 +0000
parents 6bb8d4f4a7b0
children 5cac4cf2ef94
files gui/win32/widgetrender.c
diffstat 1 files changed, 0 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/gui/win32/widgetrender.c	Mon Mar 24 11:09:39 2014 +0000
+++ b/gui/win32/widgetrender.c	Mon Mar 24 12:52:01 2014 +0000
@@ -348,20 +348,12 @@
             /* repaint the area behind the slider */
             render(skin->desktopbpp, dest, find_background(skin, item), item->wx, item->wy, item->wx, item->wy, item->width, item->wheight, 1);
             item->y = (100 - item->value) * (item->wheight-item->height) / 100 + item->wy;
-            if((item->y + item->height) > (item->wy + item->wheight))
-                item->y = item->wy + item->wheight - item->height;
-            if(item->y < item->wy)
-                item->y = item->wy;
         }
         else
         {
             /* repaint the area behind the slider */
             render(skin->desktopbpp, dest, find_background(skin, item), item->wx, item->wy, item->wx, item->wy, item->wwidth, item->height, 1);
             item->x = item->value * (item->wwidth-item->width) / 100 + item->wx;
-            if((item->x + item->width) > (item->wx + item->wwidth))
-                item->x = item->wx + item->wwidth - item->width;
-            if(item->x < item->wx)
-                item->x = item->wx;
         }
     }
     render(skin->desktopbpp, dest, img, item->x, item->y, 0, y, img->width, height, 1);