xrender: underline and strikeout fixes

Huw D M Davies h.davies1 at physics.ox.ac.uk
Thu Jul 22 05:27:18 CDT 2004


        Huw Davies <huw at codeweavers.com>
        Draw underline and strikeout lines in the non-xrender cases
        too.
-- 
Huw Davies
huw at codeweavers.com
Index: dlls/x11drv/xrender.c
===================================================================
RCS file: /home/wine/wine/dlls/x11drv/xrender.c,v
retrieving revision 1.41
diff -u -r1.41 xrender.c
--- dlls/x11drv/xrender.c	16 Jun 2004 19:02:25 -0000	1.41
+++ dlls/x11drv/xrender.c	22 Jul 2004 10:23:31 -0000
@@ -1290,45 +1293,6 @@
 	}
 	wine_tsx11_unlock();
 
-	if (lf.lfUnderline || lf.lfStrikeOut) {
-	    int linePos;
-	    unsigned int lineWidth;
-	    UINT nMetricsSize = GetOutlineTextMetricsW(hdc, 0, NULL);
-	    OUTLINETEXTMETRICW* otm = HeapAlloc(GetProcessHeap(), 0, nMetricsSize);
-	    if (!otm) goto done;
-
-	    GetOutlineTextMetricsW(hdc, nMetricsSize, otm);
-
-            wine_tsx11_lock();
-	    XSetForeground( gdi_display, physDev->gc, physDev->textPixel );
-
-	    if (lf.lfUnderline) {
-                linePos = X11DRV_YWStoDS(physDev, otm->otmsUnderscorePosition);
-                lineWidth = X11DRV_YWStoDS(physDev, otm->otmsUnderscoreSize);
-
-                XSetLineAttributes( gdi_display, physDev->gc, lineWidth,
-                                    LineSolid, CapProjecting, JoinBevel );
-                XDrawLine( gdi_display, physDev->drawable, physDev->gc,
-                           physDev->org.x + x - linePos * sinEsc,
-                           physDev->org.y + y - linePos * cosEsc,
-                           physDev->org.x + x + width * cosEsc - linePos * sinEsc,
-                           physDev->org.y + y - width * sinEsc - linePos * cosEsc );
-	    }
-
-	    if (lf.lfStrikeOut) { 
-                linePos = X11DRV_YWStoDS(physDev, otm->otmsStrikeoutPosition);
-                lineWidth = X11DRV_YWStoDS(physDev, otm->otmsStrikeoutSize);
-
-                XSetLineAttributes( gdi_display, physDev->gc, lineWidth,
-                                    LineSolid, CapProjecting, JoinBevel );
-                XDrawLine( gdi_display, physDev->drawable, physDev->gc,
-                           physDev->org.x + x, physDev->org.y + y - linePos,
-                           physDev->org.x + x + width, physDev->org.y + y - linePos );
-	    } 
-            wine_tsx11_unlock();
-	    HeapFree(GetProcessHeap(), 0, otm);
-	}
-
     } else {
         INT offset = 0, xoff = 0, yoff = 0;
         wine_tsx11_lock();
@@ -1486,6 +1450,45 @@
     }
     LeaveCriticalSection(&xrender_cs);
 
+    if (lf.lfUnderline || lf.lfStrikeOut) {
+        int linePos;
+        unsigned int lineWidth;
+        UINT nMetricsSize = GetOutlineTextMetricsW(hdc, 0, NULL);
+        OUTLINETEXTMETRICW* otm = HeapAlloc(GetProcessHeap(), 0, nMetricsSize);
+        if (!otm) goto done;
+
+        GetOutlineTextMetricsW(hdc, nMetricsSize, otm);
+
+        wine_tsx11_lock();
+        XSetForeground( gdi_display, physDev->gc, physDev->textPixel );
+
+        if (lf.lfUnderline) {
+            linePos = X11DRV_YWStoDS(physDev, otm->otmsUnderscorePosition);
+            lineWidth = X11DRV_YWStoDS(physDev, otm->otmsUnderscoreSize);
+
+            XSetLineAttributes( gdi_display, physDev->gc, lineWidth,
+                                LineSolid, CapProjecting, JoinBevel );
+            XDrawLine( gdi_display, physDev->drawable, physDev->gc,
+                       physDev->org.x + x - linePos * sinEsc,
+                       physDev->org.y + y - linePos * cosEsc,
+                       physDev->org.x + x + width * cosEsc - linePos * sinEsc,
+                       physDev->org.y + y - width * sinEsc - linePos * cosEsc );
+        }
+
+        if (lf.lfStrikeOut) { 
+            linePos = X11DRV_YWStoDS(physDev, otm->otmsStrikeoutPosition);
+            lineWidth = X11DRV_YWStoDS(physDev, otm->otmsStrikeoutSize);
+            
+            XSetLineAttributes( gdi_display, physDev->gc, lineWidth,
+                                LineSolid, CapProjecting, JoinBevel );
+            XDrawLine( gdi_display, physDev->drawable, physDev->gc,
+                       physDev->org.x + x, physDev->org.y + y - linePos,
+                       physDev->org.x + x + width, physDev->org.y + y - linePos );
+        }
+        wine_tsx11_unlock();
+        HeapFree(GetProcessHeap(), 0, otm);
+    }
+
     if(deltas && deltas != lpDx)
         HeapFree(GetProcessHeap(), 0, deltas);
 



More information about the wine-patches mailing list