Commit f45befe4 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

Draw underline and strikeout lines in the non-xrender cases too.

parent 11a61a8e
...@@ -1290,45 +1290,6 @@ BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flag ...@@ -1290,45 +1290,6 @@ BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flag
} }
wine_tsx11_unlock(); 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 { } else {
INT offset = 0, xoff = 0, yoff = 0; INT offset = 0, xoff = 0, yoff = 0;
wine_tsx11_lock(); wine_tsx11_lock();
...@@ -1486,6 +1447,45 @@ BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flag ...@@ -1486,6 +1447,45 @@ BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flag
} }
LeaveCriticalSection(&xrender_cs); 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) if(deltas && deltas != lpDx)
HeapFree(GetProcessHeap(), 0, deltas); HeapFree(GetProcessHeap(), 0, deltas);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment