fromCenter static method

Rectangle<double> fromCenter(
  1. Point<double> center,
  2. Point<double> size
)

Implementation

static math.Rectangle<double> fromCenter(
    math.Point<double> center, math.Point<double> size) {
  return math.Rectangle<double>.fromPoints(
      math.Point<double>(center.x - size.x / 2, center.y - size.y / 2),
      math.Point<double>(center.x + size.x / 2, center.y + size.y / 2));
}