for (int i = 0; i <= bounds.height; i++) { for (int j = 0; j <= bounds.width; j++) {
for (int i = 0; i <= bounds.height+1; i++) { for (int j = 0; j <= bounds.width+1; j++) {
    public Rectangle commitPaint(MultilayerPlane mp, int x, int y, int initLayer) {        Rectangle bounds = shape.getBounds();        int centerx = (int)(x - (bounds.width / 2));        int centery = (int)(y - (bounds.height / 2));        // TODO: This loop does not take all edges into account        for(int l=0;l<numLayers;l++) {        	TileLayer tl = (TileLayer) mp.getLayer(initLayer - l);        	if(tl != null) {		        for (int i = 0; i <= bounds.height; i++) {		            for (int j = 0; j <= bounds.width; j++) {		                if (shape.contains(j, i)) {		                    tl.setTileAt(j + centerx, i + centery, paintTile);		                }		            }		        }        	}        }                // Return affected area        return new Rectangle(centerx, centery, bounds.width, bounds.height);    }