code: public void ensureSurrounds(CmsPositionBean child, int padding) {
  
          // increase the size of the outer rectangle
          if ((getLeft() + padding) > child.getLeft()) {
              int diff = getLeft() - child.getLeft();
              // ensure padding
              diff += padding;
              setLeft(getLeft() - diff);
              setWidth(getWidth() + diff);
          }
          if ((getTop() + padding) > child.getTop()) {
              int diff = getTop() - child.getTop();
              diff += padding;
              setTop(getTop() - diff);
              setHeight(getHeight() + diff);
          }
          if ((getLeft() + getWidth()) < (child.getLeft() + child.getWidth() + padding)) {
              int diff = (child.getLeft() + child.getWidth()) - (getLeft() + getWidth());
              diff += padding;
              setWidth(getWidth() + diff);
          }
          if ((getTop() + getHeight()) < (child.getTop() + child.getHeight() + padding)) {
              int diff = (child.getTop() + child.getHeight()) - (getTop() + getHeight());
              diff += padding;
              setHeight(getHeight() + diff);
          }
      }
docs: Increases the dimensions to completely surround the child.<p>
  
  @param child the child position info
  @param padding the padding to apply