Transform2D.trs constructor

Transform2D.trs({
  1. Offset translation = Offset.zero,
  2. double rotationDeg = 0,
  3. double scaleX = 1,
  4. double scaleY = 1,
})

Builds a translate * rotate * scale transform.

The resulting matrix applies scaling first, then rotation, then translation when transforming a point.

Implementation

factory Transform2D.trs({
  Offset translation = Offset.zero,
  double rotationDeg = 0,
  double scaleX = 1,
  double scaleY = 1,
}) {
  return Transform2D.translation(translation)
      .multiply(Transform2D.rotationDeg(rotationDeg))
      .multiply(Transform2D.scale(scaleX, scaleY));
}