Taking height of a screen in consideration when calculating transition speed