code: public void add (IRectangle r) {
          int x1 = Math.min(x, r.x());
          int x2 = Math.max(x + width, r.x() + r.width());
          int y1 = Math.min(y, r.y());
          int y2 = Math.max(y + height, r.y() + r.height());
          setBounds(x1, y1, x2 - x1, y2 - y1);
      }
docs: Expands the bounds of this rectangle to contain the supplied rectangle.