mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-02 20:18:28 +00:00
gdi: A better workaround for extended user style pens.
This commit is contained in:
parent
76c469e5a4
commit
434a60ba1d
4 changed files with 56 additions and 36 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue