fixes for PaintBorderEdges

git-svn-id: svn://10.0.0.236/trunk@16741 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
buster%netscape.com
1998-12-21 06:37:10 +00:00
parent 2b86e9ad34
commit 49403601af
2 changed files with 44 additions and 12 deletions

View File

@@ -1011,10 +1011,6 @@ void nsCSSRendering::PaintBorderEdges(nsIPresContext& aPresContext,
if (0 == aBorderEdges->mMaxBorderWidth.left)
aSkipSides |= (1 << NS_SIDE_LEFT);
nsRect inside(aBounds);
nsRect outside(inside);
outside.Deflate(aBorderEdges->mMaxBorderWidth);
/* XXX ignoring dotted and dashed for now */
#if 0
//see if any sides are dotted or dashed
@@ -1035,9 +1031,14 @@ void nsCSSRendering::PaintBorderEdges(nsIPresContext& aPresContext,
if (0 == (aSkipSides & (1<<NS_SIDE_TOP))) {
PRInt32 segmentCount = aBorderEdges->mEdges[NS_SIDE_TOP].Count();
PRInt32 i;
nscoord x=0;
for (i=0; i<segmentCount; i++)
{
nsBorderEdge * borderEdge = (nsBorderEdge *)(aBorderEdges->mEdges[NS_SIDE_TOP].ElementAt(i));
nsRect inside(x, aBounds.y, borderEdge->mLength, aBounds.height);
x += borderEdge->mLength;
nsRect outside(inside);
outside.Deflate(aBorderEdges->mMaxBorderWidth);
DrawSide(aRenderingContext, NS_SIDE_TOP,
borderEdge->mStyle,
borderEdge->mColor,
@@ -1047,9 +1048,14 @@ void nsCSSRendering::PaintBorderEdges(nsIPresContext& aPresContext,
if (0 == (aSkipSides & (1<<NS_SIDE_LEFT))) {
PRInt32 segmentCount = aBorderEdges->mEdges[NS_SIDE_LEFT].Count();
PRInt32 i;
nscoord y=0;
for (i=0; i<segmentCount; i++)
{
nsBorderEdge * borderEdge = (nsBorderEdge *)(aBorderEdges->mEdges[NS_SIDE_LEFT].ElementAt(i));
nsRect inside(aBounds.x, y, aBounds.width, borderEdge->mLength);
y += borderEdge->mLength;
nsRect outside(inside);
outside.Deflate(aBorderEdges->mMaxBorderWidth);
DrawSide(aRenderingContext, NS_SIDE_LEFT,
borderEdge->mStyle,
borderEdge->mColor,
@@ -1059,10 +1065,15 @@ void nsCSSRendering::PaintBorderEdges(nsIPresContext& aPresContext,
if (0 == (aSkipSides & (1<<NS_SIDE_BOTTOM))) {
PRInt32 segmentCount = aBorderEdges->mEdges[NS_SIDE_BOTTOM].Count();
PRInt32 i;
nscoord x=0;
for (i=0; i<segmentCount; i++)
{
nsBorderEdge * borderEdge = (nsBorderEdge *)(aBorderEdges->mEdges[NS_SIDE_BOTTOM].ElementAt(i));
DrawSide(aRenderingContext, NS_SIDE_LEFT,
nsRect inside(x, aBounds.y, borderEdge->mLength, aBounds.height);
x += borderEdge->mLength;
nsRect outside(inside);
outside.Deflate(aBorderEdges->mMaxBorderWidth);
DrawSide(aRenderingContext, NS_SIDE_BOTTOM,
borderEdge->mStyle,
borderEdge->mColor,
inside, outside, printing, twipsPerPixel, aGap);
@@ -1071,10 +1082,15 @@ void nsCSSRendering::PaintBorderEdges(nsIPresContext& aPresContext,
if (0 == (aSkipSides & (1<<NS_SIDE_RIGHT))) {
PRInt32 segmentCount = aBorderEdges->mEdges[NS_SIDE_RIGHT].Count();
PRInt32 i;
nscoord y=0;
for (i=0; i<segmentCount; i++)
{
nsBorderEdge * borderEdge = (nsBorderEdge *)(aBorderEdges->mEdges[NS_SIDE_RIGHT].ElementAt(i));
DrawSide(aRenderingContext, NS_SIDE_LEFT,
nsRect inside(aBounds.x, y, aBounds.width, borderEdge->mLength);
y += borderEdge->mLength;
nsRect outside(inside);
outside.Deflate(aBorderEdges->mMaxBorderWidth);
DrawSide(aRenderingContext, NS_SIDE_RIGHT,
borderEdge->mStyle,
borderEdge->mColor,
inside, outside, printing, twipsPerPixel, aGap);