Calculate scale dimension correctly in more cases