def change_value_by_mouse_motion(self, mouse_x):
        """Change current value according to mouse motion.

        That is, the value displayed for the widget is
        incremented/decremented by a value proportional
        to the distance between the mouse position and
        the origin of the mouse dragging movement.

        Parameters
        ==========
        mouse_x (integer)
            represents the position of the mouse on the screen,
            in the x axis.
        """
        ### calculate the distance between the position of
        ### the mouse in x and the position x from where
        ### the dragging movement began
        ###
        ### the amount incremented/decremented from the
        ### value of the widget is proportional to such
        ### distance;
        delta_x_in_pixels = mouse_x - self.dragging_origin_x

        ### however, before we use it, we attenuate it
        ### a bit, to compensate for the massive number
        ### of pixels the mouse can suddenly traverse
        attenuated_delta_x = delta_x_in_pixels // MOUSE_ATTENUATION

        ### we finally calculate the increment in the value
        ### of the widget using the distance we just
        ### calculated multiplied by the current increment
        value_increment = attenuated_delta_x * self.increment

        ### the value of the widget is obtained by summing
        ### the base value with the increment
        value = self.base_value + value_increment

        ### however, before using such value, we must
        ### clamp it
        clamped_value = self.clamp_max(self.clamp_min(value))

        ### we then set its text in the widget and update
        ### the image

        self.cursor.set(str(clamped_value))
        self.update_image()

        ### we must execute extra setups depending on
        ### whether the value was actually clamped or not

        ## if the value wasn't clamped, we increment the
        ## position of the mouse dragging origin with the
        ## horizontal distance between the center of the
        ## screen and the mouse position at the beginning
        ## of this method

        if clamped_value == value:
            self.dragging_origin_x += SCREEN_RECT.centerx - mouse_x

        ## otherwise, set the clamped value as the new
        ## base value and reset the mouse dragging origin
        ## to the center of the screen

        else:

            self.base_value = clamped_value
            self.dragging_origin_x = SCREEN_RECT.centerx

        ### finally center the mouse in the screen
        SERVICES_NS.set_mouse_pos(SCREEN_RECT.center)
Change current value according to mouse motion.

        That is, the value displayed for the widget is
        incremented/decremented by a value proportional
        to the distance between the mouse position and
        the origin of the mouse dragging movement.

        Parameters
        ==========
        mouse_x (integer)
            represents the position of the mouse on the screen,
            in the x axis.
        
nodezator/widget/intfloatentry/modes.py