r=mkaply,a=blizzard
Check whether or not text color has been set
This commit is contained in:
mkaply%us.ibm.com 2001-01-30 04:49:32 +00:00
parent 812a41bfc5
commit 4addd4832e
2 changed files with 4 additions and 1 deletions

View File

@ -223,6 +223,7 @@ nsRenderingContextOS2::nsRenderingContextOS2()
mCurrDrawingColor = NS_RGB( 0, 0, 0);
mAlreadySetDrawingColor = PR_FALSE;
mCurrTextColor = NS_RGB( 0, 0, 0);
mAlreadySetTextColor = PR_FALSE;
mLineStyle = nsLineStyle_kSolid;
mCurrLineStyle = nsLineStyle_kSolid;
@ -957,7 +958,7 @@ void nsRenderingContextOS2::SetupFontAndColor( BOOL bForce)
mSurface->SelectFont( mCurrFontMetrics);
}
if( bForce || mColor != mCurrTextColor)
if( bForce || mColor != mCurrTextColor || !mAlreadySetTextColor)
{
CHARBUNDLE cBundle;
@ -983,6 +984,7 @@ void nsRenderingContextOS2::SetupFontAndColor( BOOL bForce)
FALSE);
mCurrTextColor = mColor;
mAlreadySetTextColor = PR_TRUE;
}
}

View File

@ -256,6 +256,7 @@ protected:
nsIFontMetrics *mCurrFontMetrics; // currently selected font
nscolor mCurrDrawingColor;// currently selected drawing color
PRBool mAlreadySetDrawingColor;
PRBool mAlreadySetTextColor;
PRUint8 *mGammaTable;
nscolor mCurrTextColor; // currently selected text color
nsLineStyle mCurrLineStyle; // currently selected line style