code: def ms_pan(self, viewer, event, data_x, data_y):
          
          if not self.canpan:
              return True
  
          x, y = viewer.get_last_win_xy()
          if event.state == 'move':
              data_x, data_y = self.get_new_pan(viewer, x, y,
                                                ptype=self._pantype)
              viewer.panset_xy(data_x, data_y)
  
          elif event.state == 'down':
              self.pan_set_origin(viewer, x, y, data_x, data_y)
              self.pan_start(viewer, ptype=2)
  
          else:
              self.pan_stop(viewer)
          return True
docs: A 'drag' or proportional pan, where the image is panned by
          'dragging the canvas' up or down.  The amount of the pan is
          proportionate to the length of the drag.