'Return scrollbar\'s scale factor:
ratio between pixel span height and value span height'

def get_scale_factor(self, slider=False):

    delta = (0 if slider else 2)
    vsb = self.editor.verticalScrollBar()
    position_height = ((vsb.height() - delta) - 1)
    value_height = ((vsb.maximum() - vsb.minimum()) + vsb.pageStep())
    return (float(position_height) / value_height)
