graph pan and zoom working within a rect