user32: Fix rounding in premultiplied alpha conversion for cursors and icons.

Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jinoh Kang 2022-03-15 03:14:17 +09:00 committed by Alexandre Julliard
parent 0a4af87e7f
commit c4773e1823
1 changed files with 3 additions and 3 deletions

View File

@ -775,9 +775,9 @@ static HBITMAP create_alpha_bitmap( HBITMAP color, const BITMAPINFO *src_info, c
for (i = 0, ptr = bits; i < bm.bmWidth * bm.bmHeight; i++, ptr += 4)
{
unsigned int alpha = ptr[3];
ptr[0] = ptr[0] * alpha / 255;
ptr[1] = ptr[1] * alpha / 255;
ptr[2] = ptr[2] * alpha / 255;
ptr[0] = (ptr[0] * alpha + 127) / 255;
ptr[1] = (ptr[1] * alpha + 127) / 255;
ptr[2] = (ptr[2] * alpha + 127) / 255;
}
done: