getMatrix static method

GMatrix getMatrix([
  1. double a = 1,
  2. double b = 0,
  3. double c = 0,
  4. double d = 1,
  5. double tx = 0,
  6. double ty = 0,
])

Get a GMatrix instance from the pool. If the pool is empty, a new GMatrix object is created and returned.

Implementation

static GMatrix getMatrix([
  double a = 1,
  double b = 0,
  double c = 0,
  double d = 1,
  double tx = 0,
  double ty = 0,
]) {
  if (_matrices.isEmpty) {
    return GMatrix(a, b, c, d, tx, ty);
  }
  return _matrices.removeLast()..setTo(a, b, c, d, tx, ty);
}