ClipOption.fromOffset constructor

ClipOption.fromOffset(
  1. Offset start,
  2. Offset end
)

The clip option is used to clip image.

Implementation

factory ClipOption.fromOffset(Offset start, Offset end) {
  return ClipOption(
    x: start.dx.round(),
    y: start.dy.round(),
    width: (end.dx - start.dx).round(),
    height: (end.dy - start.dy).round(),
  );
}