Rectangle.fromCenter constructor
Constructs a rectangle from its center point, width, and height.
The center
argument is assumed to be an offset from the origin.
Implementation
Rectangle.fromCenter(
{required vm.Vector2 center,
required double width,
required double height})
: this.fromLTRB(
center.x - width / 2,
center.y - height / 2,
center.x + width / 2,
center.y + height / 2,
);