def scroll(self, speed):
        """Scroll items near the mouse horizontally.

        Parameters
        ==========
        speed (integer)
            amount of pixels to move the items left or right,
            according to signal of the integer.
        """
        ### get vertical position of mouse
        _, y = SERVICES_NS.get_mouse_pos()

        ### pick list according to the area the mouse hovers

        a_list = (
            ## if the mouse is above the bottom of the
            ## items area, use the list of items
            self.items
            if y < self.items_area.bottom
            ## otherwise use the pool of available items
            else self.available_items
        )

        ### if the list has no items, there's no point in
        ### scrolling it, so we return
        if not a_list:
            return

        ### reference useful rects locally

        list_rect = a_list.rect
        scroll_boundary = self.rect.inflate(-40, 0)

        ### obtain a moved copy of the list rect
        moved_rect = list_rect.move(speed, 0)

        ### cancel the movement by returning if the
        ### moved copy of the list rect is beyond
        ### specific boundaries depending on the
        ### direction of the movement

        if speed < 0 and moved_rect.right < scroll_boundary.right:
            return

        elif speed > 0 and moved_rect.left > scroll_boundary.left:
            return

        ### if the movement wasn't cancelled in the previous
        ### step it means no boundaries were violated by
        ### the movement, so we can copy the horizontal
        ### position of the copy rect into the actual list
        ### rect
        list_rect.x = moved_rect.x
Scroll items near the mouse horizontally.

        Parameters
        ==========
        speed (integer)
            amount of pixels to move the items left or right,
            according to signal of the integer.
        
nodezator/our3rdlibs/sortingeditor/modes.py