Dmitry Timoshkov : Translate pen width from logical units only for geometric pens.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Feb 1 06:59:13 CST 2006


Module: wine
Branch: refs/heads/master
Commit: ef4fc8fd91fba52322a2e1cee55ec2abbd82d1a7
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=ef4fc8fd91fba52322a2e1cee55ec2abbd82d1a7

Author: Dmitry Timoshkov <dmitry at codeweavers.com>
Date:   Wed Feb  1 12:30:15 2006 +0100

Translate pen width from logical units only for geometric pens.

---

 dlls/wineps/pen.c |    9 ++++++---
 dlls/x11drv/pen.c |    9 +++++++--
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/dlls/wineps/pen.c b/dlls/wineps/pen.c
index 590acaf..9f92cbe 100644
--- a/dlls/wineps/pen.c
+++ b/dlls/wineps/pen.c
@@ -58,9 +58,12 @@ HPEN PSDRV_SelectPen( PSDRV_PDEVICE *phy
 
     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;
diff --git a/dlls/x11drv/pen.c b/dlls/x11drv/pen.c
index 2db5136..8fb1fa3 100644
--- a/dlls/x11drv/pen.c
+++ b/dlls/x11drv/pen.c
@@ -58,8 +58,13 @@ HPEN X11DRV_SelectPen( X11DRV_PDEVICE *p
     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 );




More information about the wine-cvs mailing list