Adapt according to the maximum value of scale width and scale height
double diameter(num d) => d * max(scaleWidth, scaleHeight);