IDisplayable disp = displayables.get(i);
double width = Math.min(boardSize.getWidth(), scrollpane.getViewport().getSize().getWidth());
double height = Math.min(boardSize.getHeight(), scrollpane.getViewport().getSize().getHeight());
Dimension drawDimension = new Dimension();
drawDimension.setSize(width, height);
disp.draw(g,
new Point((int)Math.min(boardSize.getWidth(), -getBounds().getX()),
(int)Math.min(boardSize.getHeight(),-getBounds().getY())),
drawDimension);
}
}