crop method

void crop(
  1. int top,
  2. int left,
  3. int bottom,
  4. int right,
)

Implementation

void crop(int top, int left, int bottom, int right) {
  if (top < 0) {
    throw ArgumentError('Top must be greater or equal to zero');
  }
  if (left < 0) {
    throw ArgumentError('Left must be greater or equal to zero');
  }
  if (bottom < 0) {
    throw ArgumentError('Bottom must be greater or equal to zero');
  }
  if (right < 0) {
    throw ArgumentError('Right must be greater or equal to zero');
  }

  _hasCrop = true;
  _cropTop = top;
  _cropLeft = left;
  _cropBottom = bottom;
  _cropRight = right;
}