double getWidthRatio(double val) { var res = (val / refWidth!) * 100; var temp = res * blockSizeHorizontal!; return temp; }