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