From 36a41abb9fa0c8544d0ba4662b4938c19f7e8dbb Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 24 Mar 2009 15:24:06 +0100 Subject: [PATCH] wineps.drv: Set the line join and cap styles based on the selected pen. --- dlls/wineps.drv/pen.c | 16 ++++++++++++++++ dlls/wineps.drv/ps.c | 6 +++--- dlls/wineps.drv/psdrv.h | 4 +++- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/dlls/wineps.drv/pen.c b/dlls/wineps.drv/pen.c index ab7bc5b6a76..529c7385349 100644 --- a/dlls/wineps.drv/pen.c +++ b/dlls/wineps.drv/pen.c @@ -70,6 +70,22 @@ HPEN CDECL PSDRV_SelectPen( PSDRV_PDEVICE *physDev, HPEN hpen ) if(physDev->pen.width < 0) physDev->pen.width = -physDev->pen.width; } + switch (logpen.lopnStyle & PS_JOIN_MASK) + { + default: + case PS_JOIN_ROUND: physDev->pen.join = 1; break; + case PS_JOIN_BEVEL: physDev->pen.join = 2; break; + case PS_JOIN_MITER: physDev->pen.join = 0; break; + } + + switch (logpen.lopnStyle & PS_ENDCAP_MASK) + { + default: + case PS_ENDCAP_ROUND: physDev->pen.endcap = 1; break; + case PS_ENDCAP_SQUARE: physDev->pen.endcap = 2; break; + case PS_ENDCAP_FLAT: physDev->pen.endcap = 0; break; + } + PSDRV_CreateColor(physDev, &physDev->pen.color, logpen.lopnColor); physDev->pen.style = logpen.lopnStyle & PS_STYLE_MASK; diff --git a/dlls/wineps.drv/ps.c b/dlls/wineps.drv/ps.c index fdebf46afab..1fa4f449ad6 100644 --- a/dlls/wineps.drv/ps.c +++ b/dlls/wineps.drv/ps.c @@ -129,8 +129,8 @@ static const char pssetfont[] = /* fontname, xscale, yscale, ascent, escapement "matrix concatmatrix\n" "makefont setfont\n"; -static const char pssetlinewidth[] = /* width */ -"%d setlinewidth\n"; +static const char pssetline[] = /* width, join, endcap */ +"%d setlinewidth %u setlinejoin %u setlinecap\n"; static const char pssetdash[] = /* dash, offset */ "[%s] %d setdash\n"; @@ -581,7 +581,7 @@ BOOL PSDRV_WriteSetPen(PSDRV_PDEVICE *physDev) { char buf[256]; - sprintf(buf, pssetlinewidth, physDev->pen.width); + sprintf(buf, pssetline, physDev->pen.width, physDev->pen.join, physDev->pen.endcap); PSDRV_WriteSpool(physDev, buf, strlen(buf)); if(physDev->pen.dash) { diff --git a/dlls/wineps.drv/psdrv.h b/dlls/wineps.drv/psdrv.h index 0661fdf20c2..efc8460df7e 100644 --- a/dlls/wineps.drv/psdrv.h +++ b/dlls/wineps.drv/psdrv.h @@ -326,7 +326,9 @@ typedef struct { typedef struct { INT style; - INT width; + INT width; + BYTE join; + BYTE endcap; const char* dash; PSCOLOR color; BOOL set;