code: def check_bounds(self):
          
          if not (self.camera_bounds == None):
              if self.__pan.X < self.camera_bounds.Left:
                  self.__pan[0] = self.camera_bounds.Left
  
              if self.__pan.X > self.camera_bounds.Right:
                  self.__pan[0] = self.camera_bounds.Right
  
              if self.__pan.Y < self.camera_bounds.Top:
                  self.__pan[1] = self.camera_bounds.Top
  
              if self.__pan.Y > self.camera_bounds.Bottom:
                  self.__pan[1] = self.camera_bounds.Bottom
docs: Make sure the camera is not outside if its legal range.