efficient drawing when toggling pan and zoom