private boolean useDocBg = true;
public void docStart(Graphics2D g2, SketchDocument doc) {
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
SwingGFX gfx = new SwingGFX(g2);
Paint fill = doc.getBackgroundFill();
if(fill != null && useDocBg) {
gfx.setPaint(fill);
gfx.fillRect(0,0,(int)doc.getWidth(), (int) doc.getHeight());
}
}