Commit 1425b1b9 authored by Andrew Riedi's avatar Andrew Riedi Committed by Alexandre Julliard

user32: Fix the loading of stretched cursors.

Based on patches by Henri Verbeet.
parent fdba8b85
...@@ -698,6 +698,13 @@ static HICON CURSORICON_CreateIconFromBMI( BITMAPINFO *bmi, ...@@ -698,6 +698,13 @@ static HICON CURSORICON_CreateIconFromBMI( BITMAPINFO *bmi,
DoStretch = (bmi->bmiHeader.biHeight/2 != height) || DoStretch = (bmi->bmiHeader.biHeight/2 != height) ||
(bmi->bmiHeader.biWidth != width); (bmi->bmiHeader.biWidth != width);
/* Scale the hotspot */
if (DoStretch && hotspot.x != ICON_HOTSPOT && hotspot.y != ICON_HOTSPOT)
{
hotspot.x = (hotspot.x * width) / bmi->bmiHeader.biWidth;
hotspot.y = (hotspot.y * height) / (bmi->bmiHeader.biHeight / 2);
}
if (!screen_dc) screen_dc = CreateDCW( DISPLAYW, NULL, NULL, NULL ); if (!screen_dc) screen_dc = CreateDCW( DISPLAYW, NULL, NULL, NULL );
if (screen_dc) if (screen_dc)
{ {
...@@ -723,14 +730,7 @@ static HICON CURSORICON_CreateIconFromBMI( BITMAPINFO *bmi, ...@@ -723,14 +730,7 @@ static HICON CURSORICON_CreateIconFromBMI( BITMAPINFO *bmi,
/* Create the XOR bitmap */ /* Create the XOR bitmap */
if (DoStretch) { if (DoStretch) {
if(bIcon) hXorBits = CreateCompatibleBitmap(screen_dc, width, height);
{
hXorBits = CreateCompatibleBitmap(screen_dc, width, height);
}
else
{
hXorBits = CreateBitmap(width, height, 1, 1, NULL);
}
if(hXorBits) if(hXorBits)
{ {
HBITMAP hOld; HBITMAP hOld;
......
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