clipViewerElementFromNums static method

ViewerElement<Rectangle<num>> clipViewerElementFromNums(
  1. List? clip, [
  2. Color? color
])

Implementation

static ViewerElement<Rectangle<num>> clipViewerElementFromNums(List? clip,
    [Color? color]) {
  if (clip == null) {
    return clipViewerElement(null, color);
  }

  var clipNums = parseNumsFromList(clip);

  var x = clipNums[0];
  var y = clipNums[1];
  var w = clipNums[2];
  var h = clipNums[3];

  var rect = Rectangle(x, y, w, h);
  return clipViewerElement(rect, color);
}