Alexandre Julliard : wineps.drv: Set the line join and cap styles based on the selected pen.

Alexandre Julliard julliard at winehq.org
Wed Mar 25 10:31:28 CDT 2009


Module: wine
Branch: master
Commit: 36a41abb9fa0c8544d0ba4662b4938c19f7e8dbb
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=36a41abb9fa0c8544d0ba4662b4938c19f7e8dbb

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Mar 24 15:24:06 2009 +0100

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 ab7bc5b..529c738 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 fdebf46..1fa4f44 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 0661fdf..efc8460 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;




More information about the wine-cvs mailing list