addBounds method

void addBounds(
  1. Rect bound
)

Implementation

void addBounds(Rect bound) {
  if (_regionArea.anyEmpty) {
    _regionArea
      ..minX = bound.left
      ..maxX = bound.right
      ..minY = bound.top
      ..maxY = bound.bottom;
  } else {
    if (bound.left < _regionArea.minX!) _regionArea.minX = bound.left;
    if (bound.right > _regionArea.maxX!) _regionArea.maxX = bound.right;
    if (bound.top < _regionArea.minY!) _regionArea.minY = bound.top;
    if (bound.bottom > _regionArea.maxY!) _regionArea.maxY = bound.bottom;
  }
  calculateArea();
}