calculateCroppedRect function

Rect calculateCroppedRect(
  1. VideoEditorController controller,
  2. Size layout, {
  3. Offset? min,
  4. Offset? max,
})

Calculate crop Rect area depending of controller min and max crop values and the size of the layout

Implementation

Rect calculateCroppedRect(
  VideoEditorController controller,
  Size layout, {
  Offset? min,
  Offset? max,
}) {
  final Offset minCrop = min ?? controller.minCrop;
  final Offset maxCrop = max ?? controller.maxCrop;

  return Rect.fromPoints(
    Offset(minCrop.dx * layout.width, minCrop.dy * layout.height),
    Offset(maxCrop.dx * layout.width, maxCrop.dy * layout.height),
  );
}