mirror of
https://github.com/reactos/reactos.git
synced 2025-06-09 03:10:18 +00:00
[WIN32K]
- fix up icon size before calculating the destination rectangle CORE-8782 svn path=/trunk/; revision=65356
This commit is contained in:
parent
2b4ca7374b
commit
d65a3b59a3
1 changed files with 21 additions and 20 deletions
|
@ -1175,6 +1175,27 @@ UserDrawIconEx(
|
||||||
if(psurfColor) SURFACE_ShareUnlockSurface(psurfColor);
|
if(psurfColor) SURFACE_ShareUnlockSurface(psurfColor);
|
||||||
return FALSE;
|
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 */
|
/* Calculate destination rectangle */
|
||||||
RECTL_vSetRect(&rcDest, xLeft, yTop, xLeft + cxWidth, yTop + cyHeight);
|
RECTL_vSetRect(&rcDest, xLeft, yTop, xLeft + cxWidth, yTop + cyHeight);
|
||||||
IntLPtoDP(pdc, (LPPOINT)&rcDest, 2);
|
IntLPtoDP(pdc, (LPPOINT)&rcDest, 2);
|
||||||
|
@ -1199,26 +1220,6 @@ UserDrawIconEx(
|
||||||
/* Set source rect */
|
/* Set source rect */
|
||||||
RECTL_vSetRect(&rcSrc, 0, 0, pIcon->cx, pIcon->cy);
|
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? */
|
/* Should we render off-screen? */
|
||||||
bOffScreen = hbrFlickerFreeDraw &&
|
bOffScreen = hbrFlickerFreeDraw &&
|
||||||
(GDI_HANDLE_GET_TYPE(hbrFlickerFreeDraw) == GDI_OBJECT_TYPE_BRUSH);
|
(GDI_HANDLE_GET_TYPE(hbrFlickerFreeDraw) == GDI_OBJECT_TYPE_BRUSH);
|
||||||
|
|
Loading…
Reference in a new issue