Fix for bug #13341. Changed DisplayAltFeedback() so it doesn't render the
recessed border unless there's room git-svn-id: svn://10.0.0.236/trunk@47847 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
a4ddeb9219
commit
bb35a26690
@ -410,14 +410,24 @@ nsImageFrame::DisplayAltFeedback(nsIPresContext& aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
PRInt32 aIconId)
|
||||
{
|
||||
// Display a recessed one pixel border in the inner area
|
||||
PRBool clipState;
|
||||
// Calculate the inner area
|
||||
nsRect inner;
|
||||
GetInnerArea(&aPresContext, inner);
|
||||
|
||||
float p2t;
|
||||
// Display a recessed one pixel border
|
||||
float p2t;
|
||||
nscoord borderEdgeWidth;
|
||||
aPresContext.GetScaledPixelsToTwips(&p2t);
|
||||
nsRecessedBorder recessedBorder(NSIntPixelsToTwips(1, p2t));
|
||||
borderEdgeWidth = NSIntPixelsToTwips(1, p2t);
|
||||
|
||||
// Make sure we have enough room to actually render the border within
|
||||
// our frame bounds
|
||||
if ((inner.width < 2 * borderEdgeWidth) || (inner.height < 2 * borderEdgeWidth)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Paint the border
|
||||
nsRecessedBorder recessedBorder(borderEdgeWidth);
|
||||
nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this, inner,
|
||||
inner, recessedBorder, mStyleContext, 0);
|
||||
|
||||
@ -429,6 +439,7 @@ nsImageFrame::DisplayAltFeedback(nsIPresContext& aPresContext,
|
||||
}
|
||||
|
||||
// Clip so we don't render outside the inner rect
|
||||
PRBool clipState;
|
||||
aRenderingContext.PushState();
|
||||
aRenderingContext.SetClipRect(inner, nsClipCombine_kIntersect, clipState);
|
||||
|
||||
|
||||
@ -410,14 +410,24 @@ nsImageFrame::DisplayAltFeedback(nsIPresContext& aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
PRInt32 aIconId)
|
||||
{
|
||||
// Display a recessed one pixel border in the inner area
|
||||
PRBool clipState;
|
||||
// Calculate the inner area
|
||||
nsRect inner;
|
||||
GetInnerArea(&aPresContext, inner);
|
||||
|
||||
float p2t;
|
||||
// Display a recessed one pixel border
|
||||
float p2t;
|
||||
nscoord borderEdgeWidth;
|
||||
aPresContext.GetScaledPixelsToTwips(&p2t);
|
||||
nsRecessedBorder recessedBorder(NSIntPixelsToTwips(1, p2t));
|
||||
borderEdgeWidth = NSIntPixelsToTwips(1, p2t);
|
||||
|
||||
// Make sure we have enough room to actually render the border within
|
||||
// our frame bounds
|
||||
if ((inner.width < 2 * borderEdgeWidth) || (inner.height < 2 * borderEdgeWidth)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Paint the border
|
||||
nsRecessedBorder recessedBorder(borderEdgeWidth);
|
||||
nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this, inner,
|
||||
inner, recessedBorder, mStyleContext, 0);
|
||||
|
||||
@ -429,6 +439,7 @@ nsImageFrame::DisplayAltFeedback(nsIPresContext& aPresContext,
|
||||
}
|
||||
|
||||
// Clip so we don't render outside the inner rect
|
||||
PRBool clipState;
|
||||
aRenderingContext.PushState();
|
||||
aRenderingContext.SetClipRect(inner, nsClipCombine_kIntersect, clipState);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user