Updated method for determining the center of the view.