From c4773e1823d4ed48e2f3918bf6a8753fcb2f645f Mon Sep 17 00:00:00 2001 From: Jinoh Kang Date: Tue, 15 Mar 2022 03:14:17 +0900 Subject: [PATCH] user32: Fix rounding in premultiplied alpha conversion for cursors and icons. Signed-off-by: Jinoh Kang Signed-off-by: Alexandre Julliard --- dlls/user32/cursoricon.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/user32/cursoricon.c b/dlls/user32/cursoricon.c index cab9fbde32e..abf3a5dac53 100644 --- a/dlls/user32/cursoricon.c +++ b/dlls/user32/cursoricon.c @@ -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: -- 2.11.4.GIT