Commit 434a60ba authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

gdi: A better workaround for extended user style pens.

parent 76c469e5
......@@ -401,16 +401,21 @@ static HPEN EMFDRV_CreatePenIndirect(PHYSDEV dev, HPEN hPen )
if (!GetObjectW( hPen, sizeof(emr.lopn), &emr.lopn ))
{
/* must be an extended pen */
EXTLOGPEN elp;
if (!GetObjectW( hPen, sizeof(elp), &elp ))
{
FIXME("extended pen %p not supported\n", hPen);
return 0;
}
emr.lopn.lopnStyle = elp.elpPenStyle;
emr.lopn.lopnWidth.x = elp.elpWidth;
EXTLOGPEN *elp;
INT size = GetObjectW( hPen, 0, NULL );
if (!size) return 0;
elp = HeapAlloc( GetProcessHeap(), 0, size );
GetObjectW( hPen, size, elp );
/* FIXME: add support for user style pens */
emr.lopn.lopnStyle = elp->elpPenStyle;
emr.lopn.lopnWidth.x = elp->elpWidth;
emr.lopn.lopnWidth.y = 0;
emr.lopn.lopnColor = elp.elpColor;
emr.lopn.lopnColor = elp->elpColor;
HeapFree( GetProcessHeap(), 0, elp );
}
emr.emr.iType = EMR_CREATEPEN;
......
......@@ -406,16 +406,21 @@ HPEN MFDRV_SelectPen( PHYSDEV dev, HPEN hpen )
if (!GetObject16( HPEN_16(hpen), sizeof(logpen), &logpen ))
{
/* must be an extended pen */
EXTLOGPEN elp;
if (!GetObjectW( hpen, sizeof(elp), &elp ))
{
FIXME("extended pen %p not supported\n", hpen);
return 0;
}
logpen.lopnStyle = elp.elpPenStyle;
logpen.lopnWidth.x = elp.elpWidth;
EXTLOGPEN *elp;
INT size = GetObjectW( hpen, 0, NULL );
if (!size) return 0;
elp = HeapAlloc( GetProcessHeap(), 0, size );
GetObjectW( hpen, size, elp );
/* FIXME: add support for user style pens */
logpen.lopnStyle = elp->elpPenStyle;
logpen.lopnWidth.x = elp->elpWidth;
logpen.lopnWidth.y = 0;
logpen.lopnColor = elp.elpColor;
logpen.lopnColor = elp->elpColor;
HeapFree( GetProcessHeap(), 0, elp );
}
index = MFDRV_CreatePenIndirect( dev, hpen, &logpen );
......
......@@ -44,16 +44,21 @@ HPEN PSDRV_SelectPen( PSDRV_PDEVICE *physDev, HPEN hpen )
if (!GetObjectW( hpen, sizeof(logpen), &logpen ))
{
/* must be an extended pen */
EXTLOGPEN elp;
if (!GetObjectW( hpen, sizeof(elp), &elp ))
{
FIXME("extended pen %p not supported\n", hpen);
return 0;
}
logpen.lopnStyle = elp.elpPenStyle;
logpen.lopnWidth.x = elp.elpWidth;
EXTLOGPEN *elp;
INT size = GetObjectW( hpen, 0, NULL );
if (!size) return 0;
elp = HeapAlloc( GetProcessHeap(), 0, size );
GetObjectW( hpen, size, elp );
/* FIXME: add support for user style pens */
logpen.lopnStyle = elp->elpPenStyle;
logpen.lopnWidth.x = elp->elpWidth;
logpen.lopnWidth.y = 0;
logpen.lopnColor = elp.elpColor;
logpen.lopnColor = elp->elpColor;
HeapFree( GetProcessHeap(), 0, elp );
}
TRACE("hpen = %p colour = %08lx\n", hpen, logpen.lopnColor);
......
......@@ -41,16 +41,21 @@ HPEN X11DRV_SelectPen( X11DRV_PDEVICE *physDev, HPEN hpen )
if (!GetObjectW( hpen, sizeof(logpen), &logpen ))
{
/* must be an extended pen */
EXTLOGPEN elp;
if (!GetObjectW( hpen, sizeof(elp), &elp ))
{
FIXME("extended pen %p not supported\n", hpen);
return 0;
}
logpen.lopnStyle = elp.elpPenStyle;
logpen.lopnWidth.x = elp.elpWidth;
EXTLOGPEN *elp;
INT size = GetObjectW( hpen, 0, NULL );
if (!size) return 0;
elp = HeapAlloc( GetProcessHeap(), 0, size );
GetObjectW( hpen, size, elp );
/* FIXME: add support for user style pens */
logpen.lopnStyle = elp->elpPenStyle;
logpen.lopnWidth.x = elp->elpWidth;
logpen.lopnWidth.y = 0;
logpen.lopnColor = elp.elpColor;
logpen.lopnColor = elp->elpColor;
HeapFree( GetProcessHeap(), 0, elp );
}
physDev->pen.style = logpen.lopnStyle & PS_STYLE_MASK;
......
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