double getHeightRatio(double val) { var res = (val / refHeight!) * 100; var temp = res * blockSizeVertical!; var widthTemp = getWidthRatio(val); return widthTemp > temp ? widthTemp : temp; }