Rectangle.fromPoints constructor

Rectangle.fromPoints(
  1. Vector2 a,
  2. Vector2 b
)

Construct the smallest rectangle that encloses the given offsets, treating them as vectors from the origin.

Implementation

Rectangle.fromPoints(vm.Vector2 a, vm.Vector2 b)
    : this.fromLTRB(
        math.min(a.x, b.x),
        math.min(a.y, b.y),
        math.max(a.x, b.x),
        math.max(a.y, b.y),
      );