[WIN32K]
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Sun, 8 Aug 2010 07:14:11 +0000 (07:14 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Sun, 8 Aug 2010 07:14:11 +0000 (07:14 +0000)
Fix a bug when premultiplying the color values: The / operator has a higher precedence than *=, so "x *= byte / 0xff", is always 0 unless byte == 0xff.

svn path=/branches/reactos-yarotows/; revision=48485

subsystems/win32/win32k/ntuser/cursoricon.c

index 65b89b6..917b142 100644 (file)
@@ -1352,9 +1352,9 @@ UserDrawIconEx(
             for (j = 0; j < psurf->SurfObj.sizlBitmap.cx; j++)
             {
                 Alpha = ptr[3];
-                ptr[0] *= Alpha / 0xff;
-                ptr[1] *= Alpha / 0xff;
-                ptr[2] *= Alpha / 0xff;
+                ptr[0] = (ptr[0] * Alpha) / 0xff;
+                ptr[1] = (ptr[1] * Alpha) / 0xff;
+                ptr[2] = (ptr[2] * Alpha) / 0xff;
 
                                ptr += 4;
             }