Translate pen width from logical units only for geometric pens.

This commit is contained in:
Dmitry Timoshkov 2006-02-01 12:30:15 +01:00 committed by Alexandre Julliard
parent 22204c2c80
commit ef4fc8fd91
2 changed files with 13 additions and 5 deletions

View File

@ -58,9 +58,12 @@ HPEN PSDRV_SelectPen( PSDRV_PDEVICE *physDev, HPEN hpen )
TRACE("hpen = %p colour = %08lx\n", hpen, logpen.lopnColor);
physDev->pen.width = PSDRV_XWStoDS(physDev, logpen.lopnWidth.x);
if(physDev->pen.width < 0)
physDev->pen.width = -physDev->pen.width;
physDev->pen.width = logpen.lopnWidth.x;
if (logpen.lopnStyle & PS_GEOMETRIC)
{
physDev->pen.width = PSDRV_XWStoDS( physDev, physDev->pen.width );
if(physDev->pen.width < 0) physDev->pen.width = -physDev->pen.width;
}
PSDRV_CreateColor(physDev, &physDev->pen.color, logpen.lopnColor);
physDev->pen.style = logpen.lopnStyle & PS_STYLE_MASK;

View File

@ -58,8 +58,13 @@ HPEN X11DRV_SelectPen( X11DRV_PDEVICE *physDev, HPEN hpen )
physDev->pen.endcap = logpen.lopnStyle & PS_ENDCAP_MASK;
physDev->pen.linejoin = logpen.lopnStyle & PS_JOIN_MASK;
physDev->pen.width = X11DRV_XWStoDS( physDev, logpen.lopnWidth.x );
if (physDev->pen.width < 0) physDev->pen.width = -physDev->pen.width;
physDev->pen.width = logpen.lopnWidth.x;
if (logpen.lopnStyle & PS_GEOMETRIC)
{
physDev->pen.width = X11DRV_XWStoDS( physDev, physDev->pen.width );
if (physDev->pen.width < 0) physDev->pen.width = -physDev->pen.width;
}
if (physDev->pen.width == 1) physDev->pen.width = 0; /* Faster */
if (hpen == GetStockObject( DC_PEN ))
logpen.lopnColor = GetDCPenColor( physDev->hdc );