Added the setting of the clip rect before drawing the button text

This commit is contained in:
rods@netscape.com
1999-07-28 21:37:22 +00:00
parent eca3652585
commit ce2ca16eba
@@ -303,7 +303,10 @@ nsButtonControlFrame::Paint(nsIPresContext& aPresContext,
const nsStyleColor* colorStyle = (const nsStyleColor*)mStyleContext->GetStyleData(eStyleStruct_Color);
aRenderingContext.SetFont(fontStyle->mFont);
PRBool clipState;
aRenderingContext.PushState();
aRenderingContext.SetClipRect(rect, nsClipCombine_kIntersect, clipState);
// if disabled paint
if (PR_TRUE == mRenderer.isDisabled())
{
@@ -317,6 +320,7 @@ nsButtonControlFrame::Paint(nsIPresContext& aPresContext,
aRenderingContext.SetColor(colorStyle->mColor);
aRenderingContext.DrawString(label, content.x, content.y);
aRenderingContext.PopState(clipState);
}
return NS_OK;