From 09156dd508f7e2ea9f9e9e55c5d4751e9b420498 Mon Sep 17 00:00:00 2001 From: "peterl%netscape.com" Date: Thu, 17 Sep 1998 00:15:56 +0000 Subject: [PATCH] changed overline code to use font metrics --- gfx/src/windows/nsRenderingContextWin.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/gfx/src/windows/nsRenderingContextWin.cpp b/gfx/src/windows/nsRenderingContextWin.cpp index af8f238f2a4..ea78e016323 100644 --- a/gfx/src/windows/nsRenderingContextWin.cpp +++ b/gfx/src/windows/nsRenderingContextWin.cpp @@ -1151,8 +1151,13 @@ void nsRenderingContextWin :: DrawString(const char *aString, PRUint32 aLength, mTMatrix->TransformCoord(&x,&y); ::ExtTextOut(mDC,x,y,0,NULL,aString,aLength,NULL); - if (GetFont().decorations & NS_FONT_DECORATION_OVERLINE) - DrawLine(aX, aY, aX + aWidth, aY); + PRUint8 decorations = GetFont().decorations; + if (decorations & NS_FONT_DECORATION_OVERLINE) { + nscoord offset; + nscoord size; + mFontMetrics->GetUnderline(offset, size); + FillRect(aX, aY, aWidth, size); + } } void nsRenderingContextWin :: DrawString(const PRUnichar *aString, PRUint32 aLength, @@ -1165,8 +1170,13 @@ void nsRenderingContextWin :: DrawString(const PRUnichar *aString, PRUint32 aLen mTMatrix->TransformCoord(&x,&y); ::ExtTextOutW(mDC,x,y,0,NULL,aString,aLength,NULL); - if (GetFont().decorations & NS_FONT_DECORATION_OVERLINE) - DrawLine(aX, aY, aX + aWidth, aY); + PRUint8 decorations = GetFont().decorations; + if (decorations & NS_FONT_DECORATION_OVERLINE) { + nscoord offset; + nscoord size; + mFontMetrics->GetUnderline(offset, size); + FillRect(aX, aY, aWidth, size); + } } void nsRenderingContextWin :: DrawString(const nsString& aString,