algorithm for fitting finding the scaling factor for fitting game area
into canvas area