From 49403601af1dc588f277a9b1111e4028a88f7080 Mon Sep 17 00:00:00 2001 From: "buster%netscape.com" Date: Mon, 21 Dec 1998 06:37:10 +0000 Subject: [PATCH] fixes for PaintBorderEdges git-svn-id: svn://10.0.0.236/trunk@16741 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/base/nsCSSRendering.cpp | 28 +++++++++++++++---- .../layout/html/style/src/nsCSSRendering.cpp | 28 +++++++++++++++---- 2 files changed, 44 insertions(+), 12 deletions(-) diff --git a/mozilla/layout/base/nsCSSRendering.cpp b/mozilla/layout/base/nsCSSRendering.cpp index 96c1c19032c..47be8453d7a 100644 --- a/mozilla/layout/base/nsCSSRendering.cpp +++ b/mozilla/layout/base/nsCSSRendering.cpp @@ -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<mEdges[NS_SIDE_TOP].Count(); PRInt32 i; + nscoord x=0; for (i=0; imEdges[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<mEdges[NS_SIDE_LEFT].Count(); PRInt32 i; + nscoord y=0; for (i=0; imEdges[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<mEdges[NS_SIDE_BOTTOM].Count(); PRInt32 i; + nscoord x=0; for (i=0; imEdges[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<mEdges[NS_SIDE_RIGHT].Count(); PRInt32 i; + nscoord y=0; for (i=0; imEdges[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); diff --git a/mozilla/layout/html/style/src/nsCSSRendering.cpp b/mozilla/layout/html/style/src/nsCSSRendering.cpp index 96c1c19032c..47be8453d7a 100644 --- a/mozilla/layout/html/style/src/nsCSSRendering.cpp +++ b/mozilla/layout/html/style/src/nsCSSRendering.cpp @@ -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<mEdges[NS_SIDE_TOP].Count(); PRInt32 i; + nscoord x=0; for (i=0; imEdges[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<mEdges[NS_SIDE_LEFT].Count(); PRInt32 i; + nscoord y=0; for (i=0; imEdges[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<mEdges[NS_SIDE_BOTTOM].Count(); PRInt32 i; + nscoord x=0; for (i=0; imEdges[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<mEdges[NS_SIDE_RIGHT].Count(); PRInt32 i; + nscoord y=0; for (i=0; imEdges[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);