resolveDimension static method

PDimension resolveDimension(
  1. PDimension? dimension,
  2. num? w,
  3. num? h, {
  4. PCanvasElement? element,
})

Implementation

static PDimension resolveDimension(PDimension? dimension, num? w, num? h,
    {PCanvasElement? element}) {
  if (dimension != null) {
    if (element != null) {
      PCanvasElement.resolveWithElement(dimension, element);
    }
    return dimension;
  }

  if (w == null || h == null) {
    throw ArgumentError("Invalid dimension> width: $w ; height: $h");
  }

  return PDimension(w, h);
}