code: public Bbox createFittingBox(Bbox bbox, double newRatio) {
  		double oldRatio = bbox.getWidth() / bbox.getHeight();
  		double newWidth = bbox.getWidth();
  		double newHeight = bbox.getHeight();
  		if (newRatio < oldRatio) {
  			// Keep width of bbox , decrease height to fullfill newRatio
  			newHeight = newWidth / newRatio;
  		} else {
  			// Keep height of bbox , decrease width to fullfill newRatio
  			newWidth = newHeight * newRatio;
  		}
  		Bbox result = new Bbox(0, 0, newWidth, newHeight);
  		result.setX(bbox.getX() + (bbox.getWidth() - newWidth) / 2.0);
  		result.setY(bbox.getY() + (bbox.getHeight() - newHeight) / 2.0);
  		return result;
  	}
docs: Creates the largest possible bounding box that fits around the specified bounding box but has a different
  width/height ratio. and the same centerpoint.
  
  @param bbox
  @param newRatio
  width/height ratio
  @return bbox