Author: khornicek
Date: Mon Nov 10 14:00:02 2014
New Revision: 65356
URL:
http://svn.reactos.org/svn/reactos?rev=65356&view=rev
Log:
[WIN32K]
- fix up icon size before calculating the destination rectangle
CORE-8782
Modified:
trunk/reactos/win32ss/user/ntuser/cursoricon_new.c
Modified: trunk/reactos/win32ss/user/ntuser/cursoricon_new.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/cursor…
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/cursoricon_new.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/cursoricon_new.c [iso-8859-1] Mon Nov 10 14:00:02
2014
@@ -1175,6 +1175,27 @@
if(psurfColor) SURFACE_ShareUnlockSurface(psurfColor);
return FALSE;
}
+
+ /* Fix width parameter, if needed */
+ if (!cxWidth)
+ {
+ if(diFlags & DI_DEFAULTSIZE)
+ cxWidth = is_icon(pIcon) ?
+ UserGetSystemMetrics(SM_CXICON) : UserGetSystemMetrics(SM_CXCURSOR);
+ else
+ cxWidth = pIcon->cx;
+ }
+
+ /* Fix height parameter, if needed */
+ if (!cyHeight)
+ {
+ if(diFlags & DI_DEFAULTSIZE)
+ cyHeight = is_icon(pIcon) ?
+ UserGetSystemMetrics(SM_CYICON) : UserGetSystemMetrics(SM_CYCURSOR);
+ else
+ cyHeight = pIcon->cy;
+ }
+
/* Calculate destination rectangle */
RECTL_vSetRect(&rcDest, xLeft, yTop, xLeft + cxWidth, yTop + cyHeight);
IntLPtoDP(pdc, (LPPOINT)&rcDest, 2);
@@ -1198,26 +1219,6 @@
/* Set source rect */
RECTL_vSetRect(&rcSrc, 0, 0, pIcon->cx, pIcon->cy);
-
- /* Fix width parameter, if needed */
- if (!cxWidth)
- {
- if(diFlags & DI_DEFAULTSIZE)
- cxWidth = is_icon(pIcon) ?
- UserGetSystemMetrics(SM_CXICON) : UserGetSystemMetrics(SM_CXCURSOR);
- else
- cxWidth = pIcon->cx;
- }
-
- /* Fix height parameter, if needed */
- if (!cyHeight)
- {
- if(diFlags & DI_DEFAULTSIZE)
- cyHeight = is_icon(pIcon) ?
- UserGetSystemMetrics(SM_CYICON) : UserGetSystemMetrics(SM_CYCURSOR);
- else
- cyHeight = pIcon->cy;
- }
/* Should we render off-screen? */
bOffScreen = hbrFlickerFreeDraw &&