code: def sc_pan(self, viewer, event, msg=True):
          
          if not self.canpan:
              return True
  
          # User has "Pan Reverse" preference set?
          rev = self.settings.get('pan_reverse', False)
          direction = event.direction
  
          if rev:
              direction = math.fmod(direction + 180.0, 360.0)
  
          pan_accel = self.settings.get('scroll_pan_acceleration', 1.0)
          # Internal factor to adjust the panning speed so that user-adjustable
          # scroll_pan_acceleration is normalized to 1.0 for "normal" speed
          scr_pan_adj_factor = 1.4142135623730951
          amount = (event.amount * scr_pan_adj_factor * pan_accel) / 360.0
  
          self.pan_omni(viewer, direction, amount)
          return True
docs: Interactively pan the image by scrolling motion.