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