expandToIncludeEnvelope method

void expandToIncludeEnvelope(
  1. Envelope other
)

Enlarges this Envelope so that it contains the other Envelope. Has no effect if other is wholly on or within the envelope.

@param other the Envelope to expand to include

Implementation

void expandToIncludeEnvelope(Envelope other) {
  if (other.isNull()) {
    return;
  }
  if (isNull()) {
    _minx = other.getMinX();
    _maxx = other.getMaxX();
    _miny = other.getMinY();
    _maxy = other.getMaxY();
  } else {
    if (other._minx < _minx) {
      _minx = other._minx;
    }
    if (other._maxx > _maxx) {
      _maxx = other._maxx;
    }
    if (other._miny < _miny) {
      _miny = other._miny;
    }
    if (other._maxy > _maxy) {
      _maxy = other._maxy;
    }
  }
}