boundingBox property

Rectangle get boundingBox

Axis-aligned bounding box of this polyline

Implementation

Rectangle get boundingBox {
  double minX = points.first.x, maxX = points.first.x;
  double minY = points.first.y, maxY = points.first.y;
  for (final p in points) {
    minX = min(minX, p.x);
    maxX = max(maxX, p.x);
    minY = min(minY, p.y);
    maxY = max(maxY, p.y);
  }
  return Rectangle(x: minX, y: minY, width: maxX - minX, height: maxY - minY);
}