translate method

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

Translates by x pixels (horizontal) and y pixels (vertical). Positive goes down/right.

Implementation

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

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