void copyFromAndInvert(Matrix matrix)

Source

void copyFromAndInvert(Matrix matrix) {

  var a =   matrix.a;
  var b =   matrix.b;
  var c =   matrix.c;
  var d =   matrix.d;
  var tx =  matrix.tx;
  var ty =  matrix.ty;
  var det = matrix.det;

  _data[0] =   d / det;
  _data[1] = - b / det;
  _data[2] = - c / det;
  _data[3] =   a / det;
  _data[4] = - tx * _data[0] - ty * _data[2];
  _data[5] = - tx * _data[1] - ty * _data[3];
}