def METHOD_NAME(self, event):
    """This method is called for every mouse_move event that the tool
    receives while the user is dragging the mouse.
    Implements DragTool. Moves the legend by aligning it to a corner of its
    overlay component.
    """
    # To properly move a legend (which aligns itself to a corner of its overlay
    # component), we need to modify the padding amounts as opposed to modifying
    # the position directly.
    if self.component:
        legend = self.component
        valign, halign = legend.align
        left, right, top, bottom = self.original_padding
        dy = int(event.y - self.mouse_down_position[1])
        if valign == "u":
            # we subtract dy because if the mouse moves downwards, dy is
            # negative but the top padding has increased
            legend.padding_top = top - dy
        else:
            legend.padding_bottom = bottom + dy
        dx = int(event.x - self.mouse_down_position[0])
        if halign == "r":
            legend.padding_right = right - dx
        else:
            legend.padding_left = left + dx
        event.handled = True
        legend.request_redraw()