Fixed some problems with rounded borders. r=rods

This commit is contained in:
dcone%netscape.com 2000-01-14 14:43:05 +00:00
Родитель a9bdf781f5
Коммит 8fba6004e9
2 изменённых файлов: 38 добавлений и 36 удалений

Просмотреть файл

@ -2575,18 +2575,6 @@ PRInt16 thickness;
curIndex++;
aRenderingContext.FillPolygon(polypath,curIndex);
// anti-alias this
//r = NS_GET_R(sideColor);
//g = NS_GET_G(sideColor);
//b = NS_GET_B(sideColor);
//r += (255-r)>>1;
//g += (255-g)>>1;
//b += (255-b)>>1;
//sideColor = NS_RGB(r,g,b);
//aRenderingContext.SetColor(sideColor);
break;
case NS_STYLE_BORDER_STYLE_DOUBLE:
polypath[0].x = aPoints[0].x;
@ -2736,6 +2724,7 @@ PRInt16 adjust=0;
void
RoundedRect::Set(nscoord aLeft,nscoord aTop,PRInt32 aWidth,PRInt32 aHeight,PRInt16 aRadius[4],PRInt16 aNumTwipPerPix)
{
PRBool doRound;
nscoord x,y,width,height;
int i;
@ -2758,14 +2747,26 @@ int i;
}
// are we drawing a circle
if( (aHeight==aWidth) && (mRoundness[0]>=(aWidth>>1)) ) {
mDoRound = PR_TRUE;
mRoundness[0] = aWidth>>1;
} else {
mDoRound = PR_FALSE;
// if we are drawing a circle
mDoRound = PR_FALSE;
if(aHeight==aWidth){
for(i=0;i<4;i++){
if(mRoundness[i]<(aWidth>>1)){
doRound = PR_FALSE;
break;
}
}
if(doRound){
mDoRound = PR_TRUE;
for(i=0;i<4;i++){
mRoundness[i] = aWidth>>1;
}
}
}
// important coordinates that the path hits
mLeft = x;
mTop = y;

Просмотреть файл

@ -2575,18 +2575,6 @@ PRInt16 thickness;
curIndex++;
aRenderingContext.FillPolygon(polypath,curIndex);
// anti-alias this
//r = NS_GET_R(sideColor);
//g = NS_GET_G(sideColor);
//b = NS_GET_B(sideColor);
//r += (255-r)>>1;
//g += (255-g)>>1;
//b += (255-b)>>1;
//sideColor = NS_RGB(r,g,b);
//aRenderingContext.SetColor(sideColor);
break;
case NS_STYLE_BORDER_STYLE_DOUBLE:
polypath[0].x = aPoints[0].x;
@ -2736,6 +2724,7 @@ PRInt16 adjust=0;
void
RoundedRect::Set(nscoord aLeft,nscoord aTop,PRInt32 aWidth,PRInt32 aHeight,PRInt16 aRadius[4],PRInt16 aNumTwipPerPix)
{
PRBool doRound;
nscoord x,y,width,height;
int i;
@ -2758,14 +2747,26 @@ int i;
}
// are we drawing a circle
if( (aHeight==aWidth) && (mRoundness[0]>=(aWidth>>1)) ) {
mDoRound = PR_TRUE;
mRoundness[0] = aWidth>>1;
} else {
mDoRound = PR_FALSE;
// if we are drawing a circle
mDoRound = PR_FALSE;
if(aHeight==aWidth){
for(i=0;i<4;i++){
if(mRoundness[i]<(aWidth>>1)){
doRound = PR_FALSE;
break;
}
}
if(doRound){
mDoRound = PR_TRUE;
for(i=0;i<4;i++){
mRoundness[i] = aWidth>>1;
}
}
}
// important coordinates that the path hits
mLeft = x;
mTop = y;