calculateCroppedRect function
Rect
calculateCroppedRect(
- VideoEditorController controller,
- Size layout, {
- Offset? min,
- 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),
);
}