extend method

Bounds<T> extend(
  1. CustomPoint<T> point
)

Creates a new Bounds obtained by expanding the current ones with a new point.

Implementation

Bounds<T> extend(CustomPoint<T> point) {
  return Bounds._(
    CustomPoint(
      math.min(point.x, min.x),
      math.min(point.y, min.y),
    ),
    CustomPoint(
      math.max(point.x, max.x),
      math.max(point.y, max.y),
    ),
  );
}