matrixRotate method

  1. @protected
Matrix4 matrixRotate(
  1. Matrix4 matrix,
  2. double rotation,
  3. Offset focalPoint
)

Return a new matrix representing the given matrix after applying the given rotation.

Implementation

@protected
Matrix4 matrixRotate(Matrix4 matrix, double rotation, Offset focalPoint) {
  if (rotation == 0) {
    return matrix.clone();
  }
  final Offset focalPointScene = transformationController!.toScene(
    focalPoint,
  );
  return matrix.clone()
    ..translate(focalPointScene.dx, focalPointScene.dy)
    ..rotateZ(-rotation)
    ..translate(-focalPointScene.dx, -focalPointScene.dy);
}