Fixed MakeSide() so it does a better job of drawing the correct pixels in

the case of 1-pixel thick lines
This commit is contained in:
troy%netscape.com 1998-07-21 09:30:03 +00:00
Родитель 16ebcf53a6
Коммит f4547a4ef9
2 изменённых файлов: 22 добавлений и 14 удалений

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

@ -308,12 +308,12 @@ PRIntn nsCSSRendering::MakeSide(nsPoint aPoints[],
if (borderPart == BORDER_FULL) {
thickness = inside.y - outside.y;
aPoints[np++].MoveTo(outside.x, outside.y);
aPoints[np++].MoveTo(outside.XMost(), outside.y);
if (thickness >= twipsPerPixel) {
aPoints[np++].MoveTo(inside.XMost(), inside.y);
aPoints[np++].MoveTo(inside.x, inside.y);
}
aPoints[np++].MoveTo(outside.x, outside.y);
} else if (borderPart == BORDER_INSIDE) {
aPoints[np++].MoveTo(nscoord(outside.x * borderFrac +
inside.x * borderRest),
@ -378,12 +378,16 @@ PRIntn nsCSSRendering::MakeSide(nsPoint aPoints[],
if (borderPart == BORDER_FULL) {
thickness = outside.YMost() - inside.YMost();
aPoints[np++].MoveTo(outside.x, outside.YMost());
if (thickness >= twipsPerPixel) {
aPoints[np++].MoveTo(outside.x, outside.YMost());
aPoints[np++].MoveTo(inside.x, inside.YMost());
aPoints[np++].MoveTo(inside.XMost(), inside.YMost());
aPoints[np++].MoveTo(outside.XMost(), outside.YMost());
} else {
aPoints[np++].MoveTo(outside.x, inside.YMost());
aPoints[np++].MoveTo(outside.XMost(), inside.YMost());
}
aPoints[np++].MoveTo(outside.XMost(), outside.YMost());
} else if (borderPart == BORDER_INSIDE) {
aPoints[np++].MoveTo(nscoord(outside.x * borderFrac +
inside.x * borderRest),
@ -413,12 +417,12 @@ PRIntn nsCSSRendering::MakeSide(nsPoint aPoints[],
if (borderPart == BORDER_FULL) {
thickness = outside.XMost() - inside.XMost();
aPoints[np++].MoveTo(outside.XMost(), outside.YMost());
aPoints[np++].MoveTo(outside.XMost(), outside.y);
if (thickness >= twipsPerPixel) {
aPoints[np++].MoveTo(inside.XMost(), inside.y);
aPoints[np++].MoveTo(inside.XMost(), inside.YMost());
aPoints[np++].MoveTo(outside.XMost(), outside.YMost());
aPoints[np++].MoveTo(outside.XMost(), outside.y);
}
aPoints[np++].MoveTo(inside.XMost(), inside.y);
aPoints[np++].MoveTo(inside.XMost(), inside.YMost());
} else if (borderPart == BORDER_INSIDE) {
aPoints[np++].MoveTo(inside.XMost(), inside.y);
aPoints[np++].MoveTo(nscoord(outside.XMost() * borderFrac +

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

@ -308,12 +308,12 @@ PRIntn nsCSSRendering::MakeSide(nsPoint aPoints[],
if (borderPart == BORDER_FULL) {
thickness = inside.y - outside.y;
aPoints[np++].MoveTo(outside.x, outside.y);
aPoints[np++].MoveTo(outside.XMost(), outside.y);
if (thickness >= twipsPerPixel) {
aPoints[np++].MoveTo(inside.XMost(), inside.y);
aPoints[np++].MoveTo(inside.x, inside.y);
}
aPoints[np++].MoveTo(outside.x, outside.y);
} else if (borderPart == BORDER_INSIDE) {
aPoints[np++].MoveTo(nscoord(outside.x * borderFrac +
inside.x * borderRest),
@ -378,12 +378,16 @@ PRIntn nsCSSRendering::MakeSide(nsPoint aPoints[],
if (borderPart == BORDER_FULL) {
thickness = outside.YMost() - inside.YMost();
aPoints[np++].MoveTo(outside.x, outside.YMost());
if (thickness >= twipsPerPixel) {
aPoints[np++].MoveTo(outside.x, outside.YMost());
aPoints[np++].MoveTo(inside.x, inside.YMost());
aPoints[np++].MoveTo(inside.XMost(), inside.YMost());
aPoints[np++].MoveTo(outside.XMost(), outside.YMost());
} else {
aPoints[np++].MoveTo(outside.x, inside.YMost());
aPoints[np++].MoveTo(outside.XMost(), inside.YMost());
}
aPoints[np++].MoveTo(outside.XMost(), outside.YMost());
} else if (borderPart == BORDER_INSIDE) {
aPoints[np++].MoveTo(nscoord(outside.x * borderFrac +
inside.x * borderRest),
@ -413,12 +417,12 @@ PRIntn nsCSSRendering::MakeSide(nsPoint aPoints[],
if (borderPart == BORDER_FULL) {
thickness = outside.XMost() - inside.XMost();
aPoints[np++].MoveTo(outside.XMost(), outside.YMost());
aPoints[np++].MoveTo(outside.XMost(), outside.y);
if (thickness >= twipsPerPixel) {
aPoints[np++].MoveTo(inside.XMost(), inside.y);
aPoints[np++].MoveTo(inside.XMost(), inside.YMost());
aPoints[np++].MoveTo(outside.XMost(), outside.YMost());
aPoints[np++].MoveTo(outside.XMost(), outside.y);
}
aPoints[np++].MoveTo(inside.XMost(), inside.y);
aPoints[np++].MoveTo(inside.XMost(), inside.YMost());
} else if (borderPart == BORDER_INSIDE) {
aPoints[np++].MoveTo(inside.XMost(), inside.y);
aPoints[np++].MoveTo(nscoord(outside.XMost() * borderFrac +