def on_mouse_drag(self, x, y, dx, dy, buttons, modifiers):
        bar_x, _, bar_width, _ = self._bar.get_content_region()

        absolute_distance = float(x - bar_x)
        relative_distance = absolute_distance/bar_width

        self.set_knob_pos(relative_distance)
        self._scrolled = 10
        self.re_layout()
        return True
dataset/ETHPy150Open jorgecarleitao/pyglet-gui/pyglet_gui/scrollbars.py/HScrollbar.on_mouse_drag/original