forCanvas property

Float64List get forCanvas

Give the 4x4 column-major matrix that Canvas wants

Implementation

Float64List get forCanvas {
  final r = Float64List(16);
  r[15] = 1;
  int p = 0;
  for (int col = 0; col < 2; col++) {
    for (int row = 0; row < 3; row++) {
      r[p++] = get(row, col);
    }
    p++;
  }
  p += 2;
  r[p++] = 1;
  p++;
  for (int row = 0; row < 2; row++) {
    r[p++] = get(row, 2);
  }
  return r;
}