fixed limiting pan to screen bounds