code: public void setFrameFromDiagonal (float x1, float y1, float x2, float y2) {
          float rx, ry, rw, rh;
          if (x1 < x2) {
              rx = x1;
              rw = x2 - x1;
          } else {
              rx = x2;
              rw = x1 - x2;
          }
          if (y1 < y2) {
              ry = y1;
              rh = y2 - y1;
          } else {
              ry = y2;
              rh = y1 - y2;
          }
          setFrame(rx, ry, rw, rh);
      }
docs: Sets the location and size of the framing rectangle of this shape based on the specified
  diagonal line.