code: def position_to_value(self, y):
          
          vsb = self.editor.verticalScrollBar()
          return vsb.minimum()+max([0, (y-self.offset)/self.get_scale_factor()])
docs: Convert position in pixels to value