Allow pens with styles greater than PS_INSIDEFRAME to be created with
ExtCreatePen.
This commit is contained in:
parent
713462dfc4
commit
50e96dc2a6
|
@ -97,7 +97,8 @@ HPEN WINAPI ExtCreatePen( DWORD style, DWORD width,
|
||||||
const LOGBRUSH * brush, DWORD style_count,
|
const LOGBRUSH * brush, DWORD style_count,
|
||||||
const DWORD *style_bits )
|
const DWORD *style_bits )
|
||||||
{
|
{
|
||||||
LOGPEN logpen;
|
PENOBJ * penPtr;
|
||||||
|
HPEN hpen;
|
||||||
|
|
||||||
if ((style & PS_STYLE_MASK) == PS_USERSTYLE)
|
if ((style & PS_STYLE_MASK) == PS_USERSTYLE)
|
||||||
FIXME("PS_USERSTYLE not handled\n");
|
FIXME("PS_USERSTYLE not handled\n");
|
||||||
|
@ -105,11 +106,22 @@ HPEN WINAPI ExtCreatePen( DWORD style, DWORD width,
|
||||||
if (brush->lbHatch)
|
if (brush->lbHatch)
|
||||||
FIXME("Hatches not implemented\n");
|
FIXME("Hatches not implemented\n");
|
||||||
|
|
||||||
logpen.lopnStyle = style & ~PS_TYPE_MASK;
|
hpen = GDI_AllocObject( sizeof(PENOBJ), PEN_MAGIC );
|
||||||
logpen.lopnWidth.x = (style & PS_GEOMETRIC) ? width : 1;
|
if (!hpen) return 0;
|
||||||
logpen.lopnWidth.y = 0;
|
penPtr = (PENOBJ *)GDI_HEAP_LOCK( hpen );
|
||||||
logpen.lopnColor = brush->lbColor;
|
penPtr->logpen.lopnStyle = style & ~PS_TYPE_MASK;
|
||||||
return CreatePenIndirect( &logpen );
|
|
||||||
|
/* PS_USERSTYLE and PS_ALTERNATE workaround */
|
||||||
|
if((penPtr->logpen.lopnStyle & PS_STYLE_MASK) > PS_INSIDEFRAME)
|
||||||
|
penPtr->logpen.lopnStyle =
|
||||||
|
(penPtr->logpen.lopnStyle & ~PS_STYLE_MASK) | PS_SOLID;
|
||||||
|
|
||||||
|
penPtr->logpen.lopnWidth.x = (style & PS_GEOMETRIC) ? width : 1;
|
||||||
|
penPtr->logpen.lopnWidth.y = 0;
|
||||||
|
penPtr->logpen.lopnColor = brush->lbColor;
|
||||||
|
GDI_HEAP_UNLOCK( hpen );
|
||||||
|
|
||||||
|
return hpen;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
|
Loading…
Reference in New Issue