Make slider range QRect

def make_slider_range(self, cursor_pos):
        """Make slider range QRect"""
        # The slider range indicator position follows the mouse vertical
        # position while its height corresponds to the part of the file that
        # is currently visible on screen.

        vsb = self.editor.verticalScrollBar()
        groove_height = self.get_scrollbar_position_height()
        slider_height = self.value_to_position(vsb.pageStep())-self.offset

        # Calcul the minimum and maximum y-value to constraint the slider
        # range indicator position to the height span of the scrollbar area
        # where the slider may move.
        min_ypos = self.offset
        max_ypos = groove_height + self.offset - slider_height

        # Determine the bounded y-position of the slider rect.
        slider_y = max(min_ypos, min(max_ypos, cursor_pos.y()-slider_height/2))

        return QRect(1, slider_y, self.WIDTH-2, slider_height)