'Convert value to position'

def value_to_position(self, y, slider=False):

    offset = (0 if slider else 1)
    vsb = self.editor.verticalScrollBar()
    return (((y - vsb.minimum()) * self.get_scale_factor(slider)) + offset)
