'Computes line position on Y-Axis (at the center of the line) from line
number.
:param line_number: The line number for which we want to know the
position in pixels.
:return: The center position of the line.'

def line_pos_from_number(self, line_number):

    editor = self._editor
    block = editor.document().findBlockByNumber(line_number)
    if block.isValid():
        return int(editor.blockBoundingGeometry(block).translated(editor.contentOffset()).top())
    if (line_number <= 0):
        return 0
    else:
        return int(editor.blockBoundingGeometry(block.previous()).translated(editor.contentOffset()).bottom())
