aspectRatio static method

double aspectRatio(
  1. double width,
  2. double height
)

The aspect ratio of width / height (1.0 when height is 0).

Implementation

static double aspectRatio(double width, double height) {
  if (height == 0) return 1;
  return width / height;
}