paintRect method

Rect paintRect(
  1. Rect rect
)

screen image rect to paint rect

Implementation

Rect paintRect(Rect rect) {
  if (!hasEditAction || screenCropRect == null) {
    return rect;
  }

  final Offset flipOrigin = screenCropRect!.center;
  if (hasRotateAngle) {
    rect = rotateRect(rect, flipOrigin, -_rotateRadian);
  }

  if (flipY) {
    rect = Rect.fromLTRB(
      2 * flipOrigin.dx - rect.right,
      rect.top,
      2 * flipOrigin.dx - rect.left,
      rect.bottom,
    );
  }

  if (flipX) {
    rect = Rect.fromLTRB(
      rect.left,
      2 * flipOrigin.dy - rect.bottom,
      rect.right,
      2 * flipOrigin.dy - rect.top,
    );
  }

  return rect;
}