expandBy method

void expandBy(
  1. double deltaX,
  2. double deltaY
)

Expands this envelope by a given distance in all directions. Both positive and negative distances are supported.

@param deltaX the distance to expand the envelope along the the X axis @param deltaY the distance to expand the envelope along the the Y axis

Implementation

void expandBy(double deltaX, double deltaY) {
  if (isNull()) return;

  _minx -= deltaX;
  _maxx += deltaX;
  _miny -= deltaY;
  _maxy += deltaY;

  // check for envelope disappearing
  if (_minx > _maxx || _miny > _maxy) {
    setToNull();
  }
}