code: def rebase_event(self, event):
          
          new_event = copy(event)
          if isinstance(new_event, MouseEvent):
              origin = self._canvas.origin
              new_event.x -= origin[0]
              new_event.y -= origin[1] - self._canvas.start_line
          logger.debug("New event: %s", new_event)
          return new_event
docs: Rebase the coordinates of the passed event to frame-relative coordinates.
  
          :param event: The event to be rebased.
          :returns: A new event object appropriately re-based.