transformRect function

PdfRect transformRect(
  1. Matrix4 transform,
  2. PdfRect rect
)

Implementation

PdfRect transformRect(Matrix4 transform, PdfRect rect) {
  final point1 = transformPoint(transform, rect.topLeft);
  final point2 = transformPoint(transform, rect.topRight);
  final point3 = transformPoint(transform, rect.bottomLeft);
  final point4 = transformPoint(transform, rect.bottomRight);
  return PdfRect.fromLTRB(
      math.min(point1.x, math.min(point2.x, math.min(point3.x, point4.x))),
      math.min(point1.y, math.min(point2.y, math.min(point3.y, point4.y))),
      math.max(point1.x, math.max(point2.x, math.max(point3.x, point4.x))),
      math.max(point1.y, math.max(point2.y, math.max(point3.y, point4.y))));
}