h = h + area.getPaddingTop() + area.getPaddingBottom();
// I'm not sure I should have to check for bg being null
// but I do
if ((bg != null) && (bg.alpha() == 0)) {
this.addFilledRect(rx, ry, w, -h, new PDFColor(bg));
}
// rx = rx - area.getBorderLeftWidth();
// ry = ry + area.getBorderTopWidth();
// w = w + area.getBorderLeftWidth() + area.getBorderRightWidth();
// h = h + area.getBorderTopWidth() + area.getBorderBottomWidth();
// Handle line style
// Offset for haft the line width!
BorderAndPadding bp = area.getBorderAndPadding();
// int left = rx - area.getBorderLeftWidth() / 2;
// int right = rx + w + area.getBorderRightWidth() / 2;
// int top = ry + area.getBorderTopWidth() / 2;
// int bottom = ry - h - area.getBorderBottomWidth() / 2;
// if (area.getBorderTopWidth() != 0)
// addLine(left, top, right, top, area.getBorderTopWidth(),
// new PDFColor(bp.getBorderColor(BorderAndPadding.TOP)));
// if (area.getBorderLeftWidth() != 0)
// addLine(left, ry + area.getBorderTopWidth(), left, bottom, area.getBorderLeftWidth(),
// new PDFColor(bp.getBorderColor(BorderAndPadding.LEFT)));
// if (area.getBorderRightWidth() != 0)
// addLine(right, ry + area.getBorderTopWidth(), right, bottom, area.getBorderRightWidth(),
// new PDFColor(bp.getBorderColor(BorderAndPadding.RIGHT)));
// if (area.getBorderBottomWidth() != 0)
// addLine(rx - area.getBorderLeftWidth(), bottom, rx + w + area.getBorderRightWidth(), bottom, area.getBorderBottomWidth(),
// new PDFColor(bp.getBorderColor(BorderAndPadding.BOTTOM)));
// Try using rectangles instead of lines. Line style will be a
// problem though?
int left = area.getBorderLeftWidth();
int right = area.getBorderRightWidth();
int top = area.getBorderTopWidth();
int bottom = area.getBorderBottomWidth();
// If style is solid, use filled rectangles
if (top != 0)
addFilledRect(rx, ry, w, top,
new PDFColor(bp.getBorderColor(BorderAndPadding.TOP)));
if (left != 0)
addFilledRect(rx - left, ry - h - bottom, left, h + top + bottom,
new PDFColor(bp.getBorderColor(BorderAndPadding.LEFT)));
if (right != 0)
addFilledRect(rx + w, ry - h - bottom, right, h + top + bottom,
new PDFColor(bp.getBorderColor(BorderAndPadding.RIGHT)));
if (bottom != 0)
addFilledRect(rx, ry - h - bottom, w, bottom,
new PDFColor(bp.getBorderColor(BorderAndPadding.BOTTOM)));
}