calculateCenterMatrix function

Matrix4 calculateCenterMatrix(
  1. Size screenSize,
  2. Size imageSize
)

Implementation

Matrix4 calculateCenterMatrix(Size screenSize, Size imageSize) {
  final xOffset = (screenSize.width - imageSize.width) / 2;
  final yOffset = (screenSize.height - imageSize.height) / 2;
  return Matrix4.translationValues(xOffset, yOffset, 0);
}