double getWidthRatio(double val) { double res = (val / refWidth) * 100; double temp = res * blockSizeHorizontal; // print("width$temp"); return temp; }