simplify height if statement further

just like width if statement, check it all in one shot.