PageBox page = (PageBox)pages.get(i);
c.setPage(i, page);
g.setClip(working);
Rectangle overall = page.getScreenPaintingBounds(c, pagePaintingClearanceWidth);
overall.x -= 1;
overall.y -= 1;
overall.width += 1;
overall.height += 1;
Rectangle bounds = new Rectangle(overall);
bounds.width += 1;
bounds.height += 1;
if (working.intersects(bounds)) {
page.paintBackground(c, pagePaintingClearanceWidth, Layer.PAGED_MODE_SCREEN);
page.paintMarginAreas(c, pagePaintingClearanceWidth, Layer.PAGED_MODE_SCREEN);
page.paintBorder(c, pagePaintingClearanceWidth, Layer.PAGED_MODE_SCREEN);
Color old = g.getColor();
g.setColor(Color.BLACK);
g.drawRect(overall.x, overall.y, overall.width, overall.height);
g.setColor(old);
Rectangle content = page.getPagedViewClippingBounds(c, pagePaintingClearanceWidth);
g.clip(content);
int left = pagePaintingClearanceWidth +
page.getMarginBorderPadding(c, CalculatedStyle.LEFT);
int top = page.getPaintingTop()