translateOriginalCoordinates method

Matrix4Transform translateOriginalCoordinates({
  1. double? x = 0,
  2. double? y = 0,
})

Translates by x pixels (horizontal) and y pixels (vertical), but in respect to the original coordinate system, before the translates/scales.

Example: If you rotate 30 degrees, and then call this method to translate x:10 it will translate by a distance of 10 pixels in 30 degrees.

Example: If you resize if by 1.5, and then call this method to translate x:10 it will translate by 15 pixels.

Implementation

Matrix4Transform translateOriginalCoordinates({
  double? x = 0,
  double? y = 0,
}) {
  x ??= 0;
  y ??= 0;

  return (x == 0 && y == 0) //
      ? this
      : Matrix4Transform._(m.clone()..translate(x, y));
}