getRect static method

GRect getRect([
  1. double x = 0,
  2. double y = 0,
  3. double w = 0,
  4. double h = 0,
])

Get a GRect instance from the pool.

Implementation

static GRect getRect([
  double x = 0,
  double y = 0,
  double w = 0,
  double h = 0,
]) {
  if (_rectangles.isEmpty) {
    return GRect(x, y, w, h);
  }
  return _rectangles.removeLast()..setTo(x, y, w, h);
}