Commit c4773e18 authored by Jinoh Kang's avatar Jinoh Kang Committed by Alexandre Julliard

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

parent 0a4af87e
...@@ -775,9 +775,9 @@ static HBITMAP create_alpha_bitmap( HBITMAP color, const BITMAPINFO *src_info, 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) for (i = 0, ptr = bits; i < bm.bmWidth * bm.bmHeight; i++, ptr += 4)
{ {
unsigned int alpha = ptr[3]; unsigned int alpha = ptr[3];
ptr[0] = ptr[0] * alpha / 255; ptr[0] = (ptr[0] * alpha + 127) / 255;
ptr[1] = ptr[1] * alpha / 255; ptr[1] = (ptr[1] * alpha + 127) / 255;
ptr[2] = ptr[2] * alpha / 255; ptr[2] = (ptr[2] * alpha + 127) / 255;
} }
done: done:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment